bifunctors-5.2: Bifunctors

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 Methodsbifmap :: (k :-> k) p q -> (k :-> k) (Flip k k p) (Flip k k q) Source BifunctorFunctor k k k k (Sum k k p) Source Methodsbifmap :: (k :-> k) a q -> (k :-> k) (Sum k k p a) (Sum k k p q) Source BifunctorFunctor k k k k (Product k k p) Source Methodsbifmap :: (k :-> k) a q -> (k :-> k) (Product k k p a) (Product k k p q) Source Functor f => BifunctorFunctor k k k k (Tannen * k k f) Source Methodsbifmap :: (k :-> k) p q -> (k :-> k) (Tannen * k k f p) (Tannen * k k f q) 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 Methodsbireturn :: a b c -> Sum k k p a b c Sourcebibind :: (k :-> k) a (Sum k k p q) -> (k :-> k) (Sum k k p a) (Sum k k p q) Sourcebijoin :: Sum k k p (Sum k k p a) b c -> Sum k k p a b c Source (Functor f, Monad f) => BifunctorMonad k k (Tannen * k k f) Source Methodsbireturn :: p a b -> Tannen * k k f p a b Sourcebibind :: (k :-> k) p (Tannen * k k f q) -> (k :-> k) (Tannen * k k f p) (Tannen * k k f q) Sourcebijoin :: Tannen * k k f (Tannen * k k f p) a b -> Tannen * k k f p a b Source

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

class BifunctorFunctor t => BifunctorComonad t where Source

Minimal complete definition

Methods

biextract :: t p :-> p Source

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

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

Instances

 BifunctorComonad k k (Product k k p) Source Methodsbiextract :: Product k k p a b c -> a b c Sourcebiextend :: (k :-> k) (Product k k p a) q -> (k :-> k) (Product k k p a) (Product k k p q) Sourcebiduplicate :: Product k k p a b c -> Product k k p (Product k k p a) b c Source Comonad f => BifunctorComonad k k (Tannen * k k f) Source Methodsbiextract :: Tannen * k k f p a b -> p a b Sourcebiextend :: (k :-> k) (Tannen * k k f p) q -> (k :-> k) (Tannen * k k f p) (Tannen * k k f q) Sourcebiduplicate :: Tannen * k k f p a b -> Tannen * k k f (Tannen * k k f p) a b Source

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