Data.Bifunctor.Functor

bifunctors-5.3: 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
  - bifmap :: (p :-> q) -> t p :-> t q
- class BifunctorFunctor t => BifunctorMonad t where
  - bireturn :: p :-> t p
  - bibind :: (p :-> t q) -> t p :-> t q
  - bijoin :: t (t p) :-> t p
- biliftM :: BifunctorMonad t => (p :-> q) -> t p :-> t q
- class BifunctorFunctor t => BifunctorComonad t where
  - biextract :: t p :-> p
  - biextend :: (t p :-> q) -> t p :-> t q
  - biduplicate :: t p :-> t (t p)
- biliftW :: BifunctorComonad t => (p :-> q) -> t p :-> t q

# 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