Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type (_, _) t =
- | [] : ('a, unit) t
- | (::) : 'a * ('a, 'r) t -> ('a, unit -> 'r) t
- let rec map : type a b r. (a -> b) -> (a, r) t -> (b, r) t =
- fun f -> function
- | [] -> []
- | h :: t -> f h :: map f t
- let [ x ; y ; z ] = map string_of_int [ 1 ; 2 ; 3 ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement