Skip to content

Instantly share code, notes, and snippets.

@manveru
Created October 19, 2010 03:38
Show Gist options
  • Save manveru/633564 to your computer and use it in GitHub Desktop.
Save manveru/633564 to your computer and use it in GitHub Desktop.
let p = function
| `Int i -> print_endline (string_of_int i)
| `Float f -> print_endline (string_of_float f)
| `String s -> print_endline s
;;
let upper = 42 in
let lower = -upper in
let x = 0 in
let y = 0 in
let i = 0 in
let ratio = float (upper + 1) in
p (`Int upper);
p (`Int lower);
p (`Int x);
p (`Int y);
p (`Int i);
p (`Float ratio)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment