Skip to content

Instantly share code, notes, and snippets.

@camlspotter
Created January 22, 2015 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camlspotter/4d963db5b9af8e7ddfd5 to your computer and use it in GitHub Desktop.
Save camlspotter/4d963db5b9af8e7ddfd5 to your computer and use it in GitHub Desktop.
type t =
| Pair of t * t
| Number of int
| Function of string (* or what? *)
let rec empty = Pair (empty, empty) (* make a looped value *)
let is_empty t = match t with
| Pair (t1, t2) -> t == t1 && t == t2 (* using pointer equality *)
| _ -> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment