bifunctors-5.6.2: Bifunctors

Safe Haskell | Safe
Language | Haskell2010

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

Instances details

BifunctorFunctor (Flip :: (k3 -> k2 -> Type) -> k2 -> k3 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Flip Methods bifmap :: forall (p :: k -> k1 -> Type) (q :: k -> k1 -> Type). (p :-> q) -> Flip p :-> Flip q Source #
BifunctorFunctor (Product p :: (k2 -> k3 -> Type) -> k2 -> k3 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Product Methods bifmap :: forall (p0 :: k -> k1 -> Type) (q :: k -> k1 -> Type). (p0 :-> q) -> Product p p0 :-> Product p q Source #
BifunctorFunctor (Sum p :: (k2 -> k3 -> Type) -> k2 -> k3 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Sum Methods bifmap :: forall (p0 :: k -> k1 -> Type) (q :: k -> k1 -> Type). (p0 :-> q) -> Sum p p0 :-> Sum p q Source #
Functor f => BifunctorFunctor (Tannen f :: (k2 -> k3 -> Type) -> k2 -> k3 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Tannen Methods bifmap :: forall (p :: k -> k1 -> Type) (q :: k -> k1 -> Type). (p :-> q) -> Tannen f p :-> Tannen 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

Instances details

BifunctorMonad (Sum p :: (k -> k1 -> Type) -> k -> k1 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Sum Methods bireturn :: forall (p0 :: k0 -> k10 -> Type). p0 :-> Sum p p0 Source # bibind :: forall (p0 :: k0 -> k10 -> Type) (q :: k0 -> k10 -> Type). (p0 :-> Sum p q) -> Sum p p0 :-> Sum p q Source # bijoin :: forall (p0 :: k0 -> k10 -> Type). Sum p (Sum p p0) :-> Sum p p0 Source #
(Functor f, Monad f) => BifunctorMonad (Tannen f :: (k -> k1 -> Type) -> k -> k1 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Tannen Methods bireturn :: forall (p :: k0 -> k10 -> Type). p :-> Tannen f p Source # bibind :: forall (p :: k0 -> k10 -> Type) (q :: k0 -> k10 -> Type). (p :-> Tannen f q) -> Tannen f p :-> Tannen f q Source # bijoin :: forall (p :: k0 -> k10 -> Type). Tannen f (Tannen f p) :-> Tannen f p 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

Instances details

BifunctorComonad (Product p :: (k -> k1 -> Type) -> k -> k1 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Product Methods biextract :: forall (p0 :: k0 -> k10 -> Type). Product p p0 :-> p0 Source # biextend :: forall (p0 :: k0 -> k10 -> Type) (q :: k0 -> k10 -> Type). (Product p p0 :-> q) -> Product p p0 :-> Product p q Source # biduplicate :: forall (p0 :: k0 -> k10 -> Type). Product p p0 :-> Product p (Product p p0) Source #
Comonad f => BifunctorComonad (Tannen f :: (k -> k1 -> Type) -> k -> k1 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Tannen Methods biextract :: forall (p :: k0 -> k10 -> Type). Tannen f p :-> p Source # biextend :: forall (p :: k0 -> k10 -> Type) (q :: k0 -> k10 -> Type). (Tannen f p :-> q) -> Tannen f p :-> Tannen f q Source # biduplicate :: forall (p :: k0 -> k10 -> Type). Tannen f p :-> Tannen f (Tannen f p) Source #

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