| Copyright | Allele Dev 2016 |
|---|---|
| License | BSD-3 |
| Maintainer | allele.dev@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Open.Union
Description
This implementation relies on _closed_ type families added to GHC 7.8. It has NO overlapping instances and NO Typeable. Alas, the absence of Typeable means the projections and injections generally take linear time. The code illustrate how to use closed type families to disambiguate otherwise overlapping instances.
The data constructors of Union are not exported. Essentially, the nested Either data type.
Using http://okmij.org/ftp/Haskell/extensible/OpenUnion41.hs as a starting point.
Documentation
type family Members m r :: Constraint where ... #
class Functor (f :: * -> *) where #
The Functor class is used for types that can be mapped over.
Instances of Functor should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The instances of Functor for lists, Maybe and IO
satisfy these laws.
Minimal complete definition
Instances