~jojo/Carth

Release 0.0.2. Update CHANGELOG & bump version
TODO: Mark datatype redundancy and exhaustiveness checking as done
Add some test-cases for specific typecheck errors
Change avg depth of Arbitrary expr trees & run 10k tests

Previous values sometimes seemed to cause divergence
Update testing Arbitrary insts for updated AST
Add phantom param to Id to encode upper/lower case

Will be useful when instancing Arbitrary, to have separate instances
for each case.
Integrate Match with rest of compiler

Until now, the Match module was just kind of for "testing". It wasn't
actually used in the rest of the compiler. This commit replaces my
earlier, quite bad implementation of pattern matching to decision
trees with Sestofts one.

One major change made along the way was to how sub-matchees are
accessed in the code-generator and interpreter. Previously, the
decision tree was assumed to be structured such that we could simply
extract sub-matchees and put them on a stack. As far as I understand
it, that way is incompatible with Sestofts trees, as they can "skip"
steps that are known to be irrefutable in context. As such, I have
chosen to augment the `Access` type with some additional information,
such that the value of a sub-matchee can simply be generated from the
Access-path as needed, with memoization in the Selections module. See
`genSelect`.
Match: switchify & add variable bindings
Match: Throw TypeErr
Oops forgot to read from monad instead of testing variable
Match: Check for redundancy
Match: Exhaustiveness checking
~1:1 impl of alg in "ML pattern match compil..." paper by Sestoft
Throw RedundantCase error for latest case, not earliest
Fix bug where VariantTypes was appended to in toDecisionTreeRow
Add todos about unambiguous conflicting imports & tail call elim
todo: Add note about GC and linear types
Remove a couple of unnecessary comments
Add TODO about debug information in LLVM-IR
Impl pattern matching w decision trees & check for redundancy

TODO: Check for exhaustiveness. TODO: Use the stratergy in that paper
on "good decision trees" for picking columns instead of just building
the tree left-to-right.

Sorry for the big commit. This wasn't the easiest thing to
implement. Took a while to understand how the whole thing would work,
and had lots of small problems along the way. However, I'm mostly
satistied with the result.
Next