bifunctors-5.2: Bifunctors

Safe HaskellSafe
LanguageHaskell98

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 

Methods

bifmap :: (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 

Methods

bifmap :: (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 

Methods

bifmap :: (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 

Methods

bifmap :: (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 

Methods

bireturn :: a b c -> Sum k k p a b c Source

bibind :: (k :-> k) a (Sum k k p q) -> (k :-> k) (Sum k k p a) (Sum k k p q) Source

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

Methods

bireturn :: p a b -> Tannen * k k f p a b Source

bibind :: (k :-> k) p (Tannen * k k f q) -> (k :-> k) (Tannen * k k f p) (Tannen * k k f q) Source

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

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

Methods

biextract :: Product k k p a b c -> a b c Source

biextend :: (k :-> k) (Product k k p a) q -> (k :-> k) (Product k k p a) (Product k k p q) Source

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

Methods

biextract :: Tannen * k k f p a b -> p a b Source

biextend :: (k :-> k) (Tannen * k k f p) q -> (k :-> k) (Tannen * k k f p) (Tannen * k k f q) Source

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