Data Types and Match

Hakaru with several built-in data types.

Match

We use match to deconstruct out data types and access their elements.

match left(3). either(int,bool):
  left(x) : 1
  right(x): 2

We do include special syntax for pairs

match (1,2):
  (x,y): x + y