[Haskell-cafe] Type union
oleg at okmij.org
oleg at okmij.org
Wed Sep 17 10:33:41 UTC 2014
Type unions are also necessary for extensible effects. In fact, they
are the foundation of extensible effects. One implementation
http://okmij.org/ftp/Haskell/extensible/TList.hs
uses only common and uncontroversial extensions (No Typeable). It
could be converted to closed type families. The other, more optimal
implementation, relies on Typeable, so that injection and projection
become constant time, regardless of the size of the union. The
Typeable constraint can be dispensed with; see the HList
implementation of type-indexed coproducts (TIC), which are essentially
open unions.
More information about the Haskell-Cafe
mailing list