Module

Data.Functor.Pairing

Pairings between functors.

Based on http://hackage.haskell.org/package/adjunctions-0.6.0/docs/Data-Functor-Zap.html.

#Pairing

type Pairing f g = forall a b c. (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 (⋈)

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

#zap

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

#sym

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

Pairing is symmetric

#identity

identity :: Identity  Identity

The identity functor pairs with itself

#productCoproduct

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

Functor products pair with functor coproducts

#stateStore

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

StateT pairs with StoreT.

#readerEnv

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

ReaderT pairs with EnvT.

#writerTraced

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

WriterT pairs with TracedT.

#freeCofree

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

Free pairs with Cofree.

Modules