Advertisement
Guest User

Untitled

a guest
Mar 15th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.37 KB | None | 0 0
  1. type _ t =
  2.     IntLit : int -> int list t
  3.   | BoolLit : bool -> bool list t;;
  4.  
  5. let eval = fun (type a) ~(u:a t) ->
  6.   let result : a =
  7.     match u with
  8.       IntLit x -> [x]
  9.     | BoolLit x -> [x] in
  10.   List.map (fun x -> x, x) result
  11.  
  12.  
  13. File "gadt.ml", line 10, characters 27-33:
  14. Error: This expression has type a but an expression was expected of type
  15.          'a list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement