bifunctors-5.4.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 #

Minimal complete definition

bifmap

Methods

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

Instances

BifunctorFunctor k1 k k k1 (Flip k k1) # 

Methods

bifmap :: (k :-> k) p q -> (Flip k k1 :-> k) (t p) (t q) #

BifunctorFunctor k k1 k k1 (Sum k k1 p) # 

Methods

bifmap :: (k :-> k) p q -> (Sum k k1 p :-> k) (t p) (t q) #

BifunctorFunctor k k1 k k1 (Product k k1 p) # 

Methods

bifmap :: (k :-> k) p q -> (Product k k1 p :-> k) (t p) (t q) #

Functor f => BifunctorFunctor k k1 k k1 (Tannen k k1 * f) # 

Methods

bifmap :: (k :-> k) p q -> (Tannen k k1 * f :-> k) (t p) (t q) #

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 k1 (Sum k k1 p) # 

Methods

bireturn :: p a b -> t p a b #

bibind :: (Sum k k1 p :-> k) p (t q) -> (Sum k k1 p :-> k) (t p) (t q) #

bijoin :: t (t p) a b -> t p a b #

(Functor f, Monad f) => BifunctorMonad k k1 (Tannen k k1 * f) # 

Methods

bireturn :: p a b -> t p a b #

bibind :: (Tannen k k1 * f :-> k) p (t q) -> (Tannen k k1 * f :-> k) (t p) (t q) #

bijoin :: t (t p) a b -> t p a b #

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 k1 (Product k k1 p) # 

Methods

biextract :: t p a b -> p a b #

biextend :: (Product k k1 p :-> k) (t p) q -> (Product k k1 p :-> k) (t p) (t q) #

biduplicate :: t p a b -> t (t p) a b #

Comonad f => BifunctorComonad k k1 (Tannen k k1 * f) # 

Methods

biextract :: t p a b -> p a b #

biextend :: (Tannen k k1 * f :-> k) (t p) q -> (Tannen k k1 * f :-> k) (t p) (t q) #

biduplicate :: t p a b -> t (t p) a b #

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