Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. type typ(_) =
  2. | Unit: typ(unit)
  3. | Int: typ(int)
  4. | Float: typ(float)
  5. | String: typ(string)
  6. | Pair((typ('a), typ('b))): typ(('a, 'b))
  7. | Arrow((typ('a), typ('b))): typ('a => 'b);
  8.  
  9. let hello: type a. (typ(a), a) => a =
  10. (ty, v) =>
  11. switch (ty) {
  12. | String => "hello"
  13. | _ => v
  14. };
Add Comment
Please, Sign In to add comment