Do these exist anywhere in GHC? Is there a reason that they don’t exist (assuming they don’t)? Would they be useful as a replacement to nested Either?
There are several implementations of sums. Here’s mine: Data.Variant
If you write
f (10 |) = ()
the compiler tells you
error: [GHC-16863]
Boxed sums not supported: ( 10 | )
but I don’t think there’s a reason for that other than lack of demand.
I use this in GHCup. It’s lovely and cursed ![]()
Got it, it’s just lack of demand, that’s what I thought was probably the case. They also don’t really have constructors, which might make it hard to implement. ((|2) can’t be made into (|) 2), without ambiguity. Thanks.