Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Original work at http://okmij.org/ftp/Haskell/extensible/OpenUnion1.hs. Open unions (type-indexed co-products) for extensible effects. This implementation relies on _closed_ overlapping instances (or closed type function overlapping soon to be added to GHC).
Documentation
Parameter r
is phantom: it just tells what could be in the union.
Where r
is t1 :> t2 ... :> tn
,
can be constructed with a
value of type Union
r vti v
.
Ideally, we should be able to add the constraint
.Member
t r
NOTE: exposing the constructor below allows users to bypass the type
system. See unsafeReUnion
for example.
A sum data type, for composing effects