Module

Data.Functor.Pairing

Package
purescript-pairing
Repository
paf31/purescript-pairing

Pairings between functors.

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

#PairingSource

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)

#zapSource

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

#symSource

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

Pairing is symmetric

#identitySource

identity :: Identity  Identity

The identity functor pairs with itself

#productCoproductSource

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

Functor products pair with functor coproducts

#stateStoreSource

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

StateT pairs with StoreT.

#readerEnvSource

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

ReaderT pairs with EnvT.

#writerTracedSource

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

WriterT pairs with TracedT.

#freeCofreeSource

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

Free pairs with Cofree.