-
-
Save mheiber/9b26c96d4019b7d50ae1153512096d2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 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