I've added basic sum types to my programming language project, and it simplifies a bunch of stuff. Bool and Unit no longer need to be built-in types!
I'm now working on wrapped data, so I can implement Option :)
miniblog.
Related Posts
TIL Rust has an ambiguity `if Foo {}` -- is `Foo` a value of type bool, or a struct?
Rust solves this by defining a grammar production 'any expression except struct literals' and using it in this position.
I've been doing more functional programming recently, and realised just how general a for loop is.
We needed a function `int list -> (bool, int) list` that would mark each item if it was the largest seen so far. Pretty straightforward.
I never know whether to write bool or boolean. I try to avoid excessive abbreviations, but bool is so snappy and very common.