Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # type _ complist =
- | One : ('a -> 'b) -> ('a * 'b) complist
- | Cons : ('a -> 'b) * ('b * 'c) complist -> ('a * 'c) complist;;
- type _ complist =
- One : ('a -> 'b) -> ('a * 'b) complist
- | Cons : ('a -> 'b) * ('b * 'c) complist -> ('a * 'c) complist
- # let rec comp_length = function
- | One _ -> 1
- | Cons (_, xs) -> 1 + comp_length xs;;
- Error: This expression has type (ex#0 * 'a) complist
- but an expression was expected of type ('b * 'a) complist
- The type constructor ex#0 would escape its scope
Advertisement
Add Comment
Please, Sign In to add comment