Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module type Format = sig
- type t
- val to_int : t -> int
- end
- module type Maker = functor (F : Format) -> sig
- type t
- val of_string : string -> t
- val of_format : t -> string
- val length : t -> int
- end
- module FirstFormat =
- struct
- type t = string
- let to_int fmt = 2
- end
- module SecondFormat =
- struct
- type t = string
- let to_int fmt = 1
- end
- module Make (F : Format) : Maker = struct
- type t = F.t
- let of_string str = str
- let of_format fmt = fmt
- let length fmt = String.length (of_format fmt)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement