Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type 'a exp =
- | C1 : int -> int exp
- | C2 : int -> int exp
- | C3 : string -> string exp
- ;;
- (* Can I do something like this *)
- let inc x = match x with | 'A(y) -> 'A(y+1);;
- (* as opposed to having to write out this *)
- 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