Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module type Convert = sig
- type t
- val to_string : t -> string
- val of_string : string -> t
- end
- type (_,_) compose =
- | Cons : (module Convert with type t = 'a) * ('b, 'c) compose -> ('a -> 'b, 'c) compose
- | Nil : ('c, 'c) compose
- let rec serialize : type f. (f, unit) compose -> f -> string = function
- | Nil -> fun () -> ""
- | Cons ((module C), rest) -> fun x -> (C.to_string x) ^ (serialize rest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement