A short post to announce that I have just released version 2.0.1 of my haskus-utils-variant package (containing Variant and EADT).

The documentation has also been greatly enhanced thanks to the feedback I’ve received:

As a short introduction, a Variant is a generic sum type (i.e. like Either but supporting any number of value types instead of just 2):

Similarly, an EADT is an extensible algebraic data type (ADT). Compared to Variant, it supports recursively defined ADT. For instance a list EADT can be defined with:

Of course the whole point of EADT is not to redefine lists in a weird way but to help with codes where we would like to add or remove ADT constructors (e.g. different abstract syntax trees (AST) in a compiler) or to support generic recursive object hierarchies (e.g. extensible GUI widget hierarchies).

Any feedback appreciated!