Advertisement
Guest User

Untitled

a guest
Jun 14th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.29 KB | None | 0 0
  1. type 'a exp =
  2.   | C1 : int -> int exp
  3.   | C2 : int -> int exp
  4.   | C3 : string -> string exp
  5. ;;
  6.  
  7. (* Can I do something like this *)
  8. let inc x = match x with | 'A(y) -> 'A(y+1);;
  9.  
  10. (* as opposed to having to write out this *)
  11. let inc x = match x with | C1(y) -> C1(y+1) | C2(y) -> C2(y+1);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement