bifunctors-5.4.2: Bifunctors

Safe Haskell | Safe
Language | Haskell98

Data.Bifunctor.Functor

Synopsis

- type (:->) p q = forall a b. p a b -> q a b
- class BifunctorFunctor t where
- class BifunctorFunctor t => BifunctorMonad t where
- biliftM :: BifunctorMonad t => (p :-> q) -> t p :-> t q
- class BifunctorFunctor t => BifunctorComonad t where
- biliftW :: BifunctorComonad t => (p :-> q) -> t p :-> t q

# 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 #

Minimal complete definition

bifmap

Methods

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

Instances

BifunctorFunctor k1 k k k1 (Flip k k1) Source # |
Methods bifmap :: (k :-> k) p q -> (Flip k k1 :-> k) (t p) (t q) Source #
BifunctorFunctor k k1 k k1 (Sum k k1 p) Source # |
Methods bifmap :: (k :-> k) p q -> (Sum k k1 p :-> k) (t p) (t q) Source #
BifunctorFunctor k k1 k k1 (Product k k1 p) Source # |
Methods bifmap :: (k :-> k) p q -> (Product k k1 p :-> k) (t p) (t q) Source #
Functor f => BifunctorFunctor k k1 k k1 (Tannen k k1 * f) Source # |
Methods bifmap :: (k :-> k) p q -> (Tannen k k1 * f :-> k) (t p) (t 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 k1 (Sum k k1 p) Source # |
Methods bireturn :: p a b -> t p a b Source # bibind :: (Sum k k1 p :-> k) p (t q) -> (Sum k k1 p :-> k) (t p) (t q) Source # bijoin :: t (t p) a b -> t p a b Source #
(Functor f, Monad f) => BifunctorMonad k k1 (Tannen k k1 * f) Source # |
Methods bireturn :: p a b -> t p a b Source # bibind :: (Tannen k k1 * f :-> k) p (t q) -> (Tannen k k1 * f :-> k) (t p) (t q) Source # bijoin :: t (t p) a b -> t p a b 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

BifunctorComonad k k1 (Product k k1 p) Source # |
Methods biextract :: t p a b -> p a b Source # biextend :: (Product k k1 p :-> k) (t p) q -> (Product k k1 p :-> k) (t p) (t q) Source # biduplicate :: t p a b -> t (t p) a b Source #
Comonad f => BifunctorComonad k k1 (Tannen k k1 * f) Source # |
Methods biextract :: t p a b -> p a b Source # biextend :: (Tannen k k1 * f :-> k) (t p) q -> (Tannen k k1 * f :-> k) (t p) (t q) Source # biduplicate :: t p a b -> t (t p) a b Source #

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