bifunctors-5.2: Bifunctors

Safe HaskellSafe
LanguageHaskell98

Data.Bifunctor.Functor

Synopsis

Documentation

type (:->) p q = forall a b. p a b -> q a b infixr 0

Using parametricity as an approximation of a natural transformation in two arguments.

class BifunctorFunctor t where

Methods

bifmap :: (p :-> q) -> t p :-> t q

Instances

BifunctorFunctor k k k k (Flip k k) 
BifunctorFunctor k k k k (Sum k k p) 
BifunctorFunctor k k k k (Product k k p) 
Functor f => BifunctorFunctor k k k k (Tannen * k k f) 

class BifunctorFunctor t => BifunctorMonad t where

Minimal complete definition

bireturn, (bibind | bijoin)

Methods

bireturn :: p :-> t p

bibind :: (p :-> t q) -> t p :-> t q

bijoin :: t (t p) :-> t p

Instances

BifunctorMonad k k (Sum k k p) 
(Functor f, Monad f) => BifunctorMonad k k (Tannen * k k f) 

biliftM :: BifunctorMonad t => (p :-> q) -> t p :-> t q

class BifunctorFunctor t => BifunctorComonad t where

Minimal complete definition

biextract, (biextend | biduplicate)

Methods

biextract :: t p :-> p

biextend :: (t p :-> q) -> t p :-> t q

biduplicate :: t p :-> t (t p)

Instances

BifunctorComonad k k (Product k k p) 
Comonad f => BifunctorComonad k k (Tannen * k k f) 

biliftW :: BifunctorComonad t => (p :-> q) -> t p :-> t q