Copyright | Allele Dev 2016 |
---|---|
License | BSD-3 |
Maintainer | allele.dev@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
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 ... Source #
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.
Functor [] | |
Functor Maybe | |
Functor IO | |
Functor V1 | |
Functor U1 | |
Functor Par1 | |
Functor ZipList | |
Functor Dual | |
Functor Sum | |
Functor Product | |
Functor First | |
Functor Last | |
Functor ((->) r) | |
Functor (Either a) | |
Functor f => Functor (Rec1 f) | |
Functor (URec Char) | |
Functor (URec Double) | |
Functor (URec Float) | |
Functor (URec Int) | |
Functor (URec Word) | |
Functor (URec (Ptr ())) | |
Functor ((,) a) | |
Functor (Array i) | |
Monad m => Functor (WrappedMonad m) | |
Arrow a => Functor (ArrowMonad a) | |
Functor (Proxy *) | |
(Functor f1, Functor (Union ((:) (* -> *) f2 fs))) => Functor (Union ((:) (* -> *) f1 ((:) (* -> *) f2 fs))) # | |
Functor f => Functor (Union ((:) (* -> *) f ([] (* -> *)))) # | |
Functor (Eff r) # | |
Functor (K1 i c) | |
(Functor g, Functor f) => Functor ((:+:) f g) | |
(Functor g, Functor f) => Functor ((:*:) f g) | |
(Functor g, Functor f) => Functor ((:.:) f g) | |
Arrow a => Functor (WrappedArrow a b) | |
Functor (Const * m) | |
Functor f => Functor (Alt * f) | |
Functor (Yield a b) # | |
Functor f => Functor (M1 i c f) | |