Guest User

Untitled

a guest
Nov 16th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. # type _ complist =
  2. | One : ('a -> 'b) -> ('a * 'b) complist
  3. | Cons : ('a -> 'b) * ('b * 'c) complist -> ('a * 'c) complist;;
  4. type _ complist =
  5. One : ('a -> 'b) -> ('a * 'b) complist
  6. | Cons : ('a -> 'b) * ('b * 'c) complist -> ('a * 'c) complist
  7.  
  8. # let rec comp_length = function
  9. | One _ -> 1
  10. | Cons (_, xs) -> 1 + comp_length xs;;
  11. Error: This expression has type (ex#0 * 'a) complist
  12. but an expression was expected of type ('b * 'a) complist
  13. The type constructor ex#0 would escape its scope
Advertisement
Add Comment
Please, Sign In to add comment