potoki-core-1.2: Low-level components of "potoki"

Safe HaskellNone
LanguageHaskell2010

Potoki.Core.Consume

Synopsis

Documentation

newtype Consume input output Source #

Active consumer of input into output. Sort of like a reducer in Map/Reduce.

Automates the management of resources.

Constructors

Consume (Fetch input -> IO output)

An action, which executes the provided fetch in IO, while managing the resources behind the scenes.

Instances

Choice Consume Source # 

Methods

left' :: Consume a b -> Consume (Either a c) (Either b c) #

right' :: Consume a b -> Consume (Either c a) (Either c b) #

Profunctor Consume Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> Consume b c -> Consume a d #

lmap :: (a -> b) -> Consume b c -> Consume a c #

rmap :: (b -> c) -> Consume a b -> Consume a c #

(#.) :: Coercible * c b => (b -> c) -> Consume a b -> Consume a c #

(.#) :: Coercible * b a => Consume b c -> (a -> b) -> Consume a c #

Functor (Consume input) Source # 

Methods

fmap :: (a -> b) -> Consume input a -> Consume input b #

(<$) :: a -> Consume input b -> Consume input a #

Applicative (Consume input) Source # 

Methods

pure :: a -> Consume input a #

(<*>) :: Consume input (a -> b) -> Consume input a -> Consume input b #

(*>) :: Consume input a -> Consume input b -> Consume input b #

(<*) :: Consume input a -> Consume input b -> Consume input a #

list :: Consume input [input] Source #

sum :: Num num => Consume num num Source #