Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2010
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # type t = Int of int
  2.   | String of string
  3.   | Float of float;;
  4. type t = Int of int | String of string | Float of float
  5. # let print = function
  6.   | Int(a) -> print_int a
  7.   | String(a) -> print_string a
  8.   | Float(a) -> print_float a
  9.   | _ -> print_endline ""
  10.   ;;
  11. Warning U: this match case is unused.
  12. val print : t -> unit = <fun>
  13. # let k = String("a");;
  14. val k : t = String "a"
  15. # print k;;
  16. a- : unit = ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement