bifunctors-5.3: Bifunctors

Safe HaskellSafe
LanguageHaskell98

Data.Bifunctor.Functor

Synopsis

Documentation

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

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

class BifunctorFunctor t where Source

Methods

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

Instances

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

class BifunctorFunctor t => BifunctorMonad t where Source

Minimal complete definition

bireturn, (bibind | bijoin)

Methods

bireturn :: p :-> t p Source

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

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

Instances

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

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

class BifunctorFunctor t => BifunctorComonad t where Source

Minimal complete definition

biextract, (biextend | biduplicate)

Methods

biextract :: t p :-> p Source

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

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

Instances

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