Guest User

Untitled

a guest
Sep 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. type i_or_f = Int of int | Float of float;;
  2. let conv x = match x with Int i -> float_of_int i | Float f -> f;;
  3.  
  4. utop # conv (Int 4);;
  5. - : float = 4.
  6. utop # conv (Float 4.);;
  7. - : float = 4.
Add Comment
Please, Sign In to add comment