On Tuesday, 26 February 2019 at 12:52:11 UTC, JN wrote:
On Monday, 25 February 2019 at 20:31:43 UTC, Paul Backus wrote:
SumType is a generic sum type for modern D. It is meant as an
alternative to
`std.variant.Algebraic`.
Is it a better alternative? Seems like it from the description.
If it's objectively better on all fronts, perhaps it should be
considered for inclusion into Phobos, as a replacement for the
existing Algebraic?
SumType isn't a drop-in replacement for Algebraic (e.g., it
removes some unsafe methods like `peek`), so it would have be
included in addition to Algebraic, rather than instead of it.
That said, if Walter, Andrei, and the rest of the Phobos team are
ok with having two implementations of essentially the same thing
in the standard library, I think SumType has reached a level of
stability where I'd be comfortable submitting it for inclusion.