jkrems/zoidberg — pull request #9 by jkrems (2014-09-13 11:57:37+00:00)
Title: Match ADT, compiled to JS

* `match` works now correctly for primitive values and enums
* enums compile to index based data structures
* enums serialize to sexpr like JSON

Demo program:
```
List(t) = enum { Empty(), Node(value: t, next: List(t)) }

length(list: List(Int)) = match list {
List.Node(value, next) => 1 + length(next)
List.Empty() => 0
}

intList =
List.Node(10, List.Node(8, List.Empty()))

main() = {
printf("Length of %j: %j", intList, length(intList));
0
}
```

Output:
```
Length of ["List.Node",10,["List.Node",8,["List.Empty"]]]: 2
```