Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.