Arc Forumnew | comments | leaders | submitlogin
1 point by absz 6115 days ago | link | parent

I'm fairly inexperienced with pure functional programming à la Haskell and ML, but isn't this a weaker variant of tagged unions? Tagged unions are (in my mind) fantastic, but what you have allows only one tagged union in the entire program. It would be nice to have Haskell's "maybe" union, which could be (just x) or (nothing). Then you could also have, say, a binary tree type* which could be (node x) or (branch btree-left btree-right), and they would be different things.

* Yes, I know that lists can represent binary trees. Yes, that's often better. However, I needed an example.