Skip to content

Instantly share code, notes, and snippets.

@i2y
Last active August 29, 2015 14:20
Show Gist options
  • Save i2y/9107b5ad6327f0061059 to your computer and use it in GitHub Desktop.
Save i2y/9107b5ad6327f0061059 to your computer and use it in GitHub Desktop.
Mochi - exmaple 2
record Cons(v, lis:List)
List = union(type(None), Cons)
match Cons(1, Cons(1, None)):
Cons(1, Cons(1, None)): print("match!")
_: print("no match!")
# -> "match!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment