Portability | non-portable (functional-dependencies) |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
transform a pair of functors with a bifunctor deriving a new functor. this subsumes functor product and functor coproduct
- newtype BifunctorF p f g a = BifunctorF {
- runBifunctorF :: p (f a) (g a)
- type :*: f g a = BifunctorF (,) f g a
- runProductF :: BifunctorF (,) f g a -> (f a, g a)
- type :+: f g a = BifunctorF Either f g a
- runCoproductF :: BifunctorF Either f g a -> Either (f a) (g a)
Bifunctor functor transformer
newtype BifunctorF p f g a Source
BifunctorF | |
|
(Bifunctor p, Functor f, Functor g) => Functor (BifunctorF p f g) | |
(Faithful f, Faithful g) => Faithful (BifunctorF (,) f g) | |
(Copointed f, Copointed g) => Copointed (BifunctorF Either f g) | |
(Pointed f, Pointed g) => Pointed (BifunctorF (,) f g) | |
(Bifunctor p, ContravariantFunctor f, ContravariantFunctor g) => ContravariantFunctor (BifunctorF p f g) | |
(Bifunctor p, ExpFunctor f, ExpFunctor g) => ExpFunctor (BifunctorF p f g) |
type :*: f g a = BifunctorF (,) f g aSource
runProductF :: BifunctorF (,) f g a -> (f a, g a)Source
type :+: f g a = BifunctorF Either f g aSource
runCoproductF :: BifunctorF Either f g a -> Either (f a) (g a)Source