kernmantle-0.1.0.0: Composing Applicatives, Monads, Comonads and Arrows into Arrows
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Profunctor.Trans

Description

This module exposes the SieveTrans class and some Sieve transformers based on usual Reader and Writer

Synopsis

Documentation

class SieveTrans f cat | cat -> f where Source #

A general version of Sieve that allows mapping and recursively reaching the sieve

Methods

liftSieve :: (a -> f b) -> cat a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> cat a b -> cat a' b' Source #

Instances

Instances details
SieveTrans m (Kleisli m) Source # 
Instance details

Defined in Data.Profunctor.Trans

Methods

liftSieve :: (a -> m b) -> Kleisli m a b Source #

mapSieve :: ((a -> m b) -> a' -> m b') -> Kleisli m a b -> Kleisli m a' b' Source #

SieveTrans f eff => SieveTrans f (AutoIdent eff) Source # 
Instance details

Defined in Control.Kernmantle.Arrow

Methods

liftSieve :: (a -> f b) -> AutoIdent eff a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> AutoIdent eff a b -> AutoIdent eff a' b' Source #

SieveTrans f (Star f) Source # 
Instance details

Defined in Data.Profunctor.Trans

Methods

liftSieve :: (a -> f b) -> Star f a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> Star f a b -> Star f a' b' Source #

SieveTrans f core => SieveTrans f (Rope record mantle core) Source # 
Instance details

Defined in Control.Kernmantle.Rope

Methods

liftSieve :: (a -> f b) -> Rope record mantle core a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> Rope record mantle core a b -> Rope record mantle core a' b' Source #

SieveTrans f core => SieveTrans f (RopeRunner record mantle interp core) Source # 
Instance details

Defined in Control.Kernmantle.Rope.Internal

Methods

liftSieve :: (a -> f b) -> RopeRunner record mantle interp core a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> RopeRunner record mantle interp core a b -> RopeRunner record mantle interp core a' b' Source #

(SieveTrans f cat, Applicative f) => SieveTrans f (Tannen f cat) Source # 
Instance details

Defined in Data.Profunctor.Trans

Methods

liftSieve :: (a -> f b) -> Tannen f cat a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> Tannen f cat a b -> Tannen f cat a' b' Source #

(SieveTrans f cat, Applicative f') => SieveTrans f (Cayley f' cat) Source # 
Instance details

Defined in Data.Profunctor.Trans

Methods

liftSieve :: (a -> f b) -> Cayley f' cat a b Source #

mapSieve :: ((a -> f b) -> a' -> f b') -> Cayley f' cat a b -> Cayley f' cat a' b' Source #

type HasKleisli = SieveTrans Source #

Just an alias

liftKleisli :: HasKleisli m eff => (a -> m b) -> eff a b Source #

Just an alias

mapKleisli :: HasKleisli m eff => ((a -> m b) -> a' -> m b') -> eff a b -> eff a' b' Source #

Just an alias

type HasKleisliIO m eff = (HasKleisli m eff, MonadIO m) Source #

liftKleisliIO :: HasKleisliIO m eff => (a -> IO b) -> eff a b Source #

When you want to lift some IO action in a Sieve of any MonadIO

type (~>) = Cayley infixr 1 Source #

An alias to make signatures more readable

type Reader r = Reader r Source #

type Writer w = Writer w Source #

fmapping :: Functor f => f t -> (t -> eff a b) -> (f ~> eff) a b Source #

mapCayleyEff :: Functor f => (eff a b -> eff' a' b') -> (f ~> eff) a b -> (f ~> eff') a' b' Source #

mapCayley in profunctors maps the functor. mapCayleyEff maps the effect in it.

reading :: (t -> eff a b) -> (Reader t ~> eff) a b Source #

mapReader :: (t' -> eff a b -> (t, eff' a' b')) -> (Reader t ~> eff) a b -> (Reader t' ~> eff') a' b' Source #

mapReader_ :: (t -> eff a b -> eff' a' b') -> (Reader t ~> eff) a b -> (Reader t ~> eff') a' b' Source #

runReader :: t -> (Reader t ~> eff) a b -> eff a b Source #

writing :: w -> eff :-> (Writer w ~> eff) Source #

mapWriter :: (w -> eff a b -> (w', eff' a' b')) -> (Writer w ~> eff) a b -> (Writer w' ~> eff') a' b' Source #

mapWriter_ :: (w -> eff a b -> eff' a' b') -> (Writer w ~> eff) a b -> (Writer w ~> eff') a' b' Source #

runWriter :: (Writer w ~> eff) a b -> (w, eff a b) Source #

runWriter_ :: (Writer w ~> eff) a b -> eff a b Source #

swap :: (a, b) -> (b, a) Source #

returning :: Arrow eff => b -> eff a b Source #

perform :: a -> Kleisli m a b -> m b Source #

Just a flipped variant of runKleisli