I like that in Rust pointers can't even be null, you have to wrap them in a kind of an "enum" (union, ish) of the pointer and Nil value.
1
1
I don't know Haskell, but looking quickly that's more like Rust's "Option" which is in std library, built using the odd "enum"
2
yeah, so Haskell Either seems to be more like Rust's language feature "enum" (only enum can take more than 2 choices...)
1
yes! which I guess is a really generic way of thinking about an enum... rustbyexample.com/custom_typ…
1
Replying to @frabcus
I'm not convinced. It sounds like a Haskell algebraic data type. Enums should be able to enumerate all their possible values.

Aug 1, 2016 Β· 4:47 PM UTC

2
Replying to @dsilverstone
yeah, it definitely can't enumerate all its possible values, and agree that does seem a weakness.
1
I agree. Sounds like Tagged Union en.wikipedia.org/wiki/Tagged… (aka "datatype" in ML)
1
Aye, though one colleague here argues that "since in C you tend to use enums for that, it's perhaps not an awful name"
1