Skip to content

Instantly share code, notes, and snippets.


mheiber/ Secret

Last active Apr 18, 2021
What would you like to do?
(* ocaml *)
type tag = X | Y
let make_point x y = function
| X -> x
| Y -> y
let get_x pt = pt X
let get_y pt = pt Y
let pt = make_point 1 2
let () = Printf.printf "%d %d" (get_x pt) (get_y pt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment