Pairings between functors.

Based on

#Pairing Source

type Pairing f g = forall c b a. (a -> b -> c) -> f a -> g b -> c

A pairing between functors f and g.

This asserts that any sums in f can annihilate any products in g, and vice versa.

This library provides some useful pairings, and ways of lifting pairings over various constructions on Functors.

#type (⋈) Source

Operator alias for Data.Functor.Pairing.Pairing (non-associative / precedence 4)

#zap Source

zap :: forall b a g f. f  g -> f (a -> b) -> g a -> b

#sym Source

sym :: forall g f. f  g -> g  f

Pairing is symmetric

#identity Source

identity :: Identity  Identity

The identity functor pairs with itself

#productCoproduct Source

productCoproduct :: forall g2 f2 g1 f1. f1  g1 -> f2  g2 -> (Product f1 f2)  (Coproduct g1 g2)

Functor products pair with functor coproducts

#stateStore Source

stateStore :: forall s g f. f  g -> (StateT s f)  (StoreT s g)

StateT pairs with StoreT.

#readerEnv Source

readerEnv :: forall e g f. f  g -> (ReaderT e f)  (EnvT e g)

ReaderT pairs with EnvT.

#writerTraced Source

writerTraced :: forall w g f. f  g -> (WriterT w f)  (TracedT w g)

WriterT pairs with TracedT.

#freeCofree Source

freeCofree :: forall g f. Functor f => Functor g => f  g -> (Free f)  (Cofree g)

Free pairs with Cofree.