Module

Data.Functor.Pairing

Package
purescript-open-pairing
Repository
purescript-open-community/purescript-open-pairing

Pairings between functors.

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

#Pairing Source

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 (⋈) Source

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

#zap Source

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

#sym Source

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

Pairing is symmetric

#identity Source

identity :: Identity  Identity

The identity functor pairs with itself

#productCoproduct Source

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

Functor products pair with functor coproducts

#stateStore Source

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

StateT pairs with StoreT.

#readerEnv Source

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

ReaderT pairs with EnvT.

#writerTraced Source

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

WriterT pairs with TracedT.

#freeCofree Source

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

Free pairs with Cofree.