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

Safe HaskellNone
LanguageHaskell2010

Potoki.Core.Fetch

Synopsis

Documentation

newtype Fetch element Source #

Passive producer of elements.

Constructors

Fetch (forall x. x -> (element -> x) -> IO x)

Something close to a Church encoding of IO (Maybe element).

Instances

Monad Fetch Source # 

Methods

(>>=) :: Fetch a -> (a -> Fetch b) -> Fetch b #

(>>) :: Fetch a -> Fetch b -> Fetch b #

return :: a -> Fetch a #

fail :: String -> Fetch a #

Functor Fetch Source # 

Methods

fmap :: (a -> b) -> Fetch a -> Fetch b #

(<$) :: a -> Fetch b -> Fetch a #

Applicative Fetch Source # 

Methods

pure :: a -> Fetch a #

(<*>) :: Fetch (a -> b) -> Fetch a -> Fetch b #

(*>) :: Fetch a -> Fetch b -> Fetch b #

(<*) :: Fetch a -> Fetch b -> Fetch a #

Alternative Fetch Source # 

Methods

empty :: Fetch a #

(<|>) :: Fetch a -> Fetch a -> Fetch a #

some :: Fetch a -> Fetch [a] #

many :: Fetch a -> Fetch [a] #

MonadPlus Fetch Source # 

Methods

mzero :: Fetch a #

mplus :: Fetch a -> Fetch a -> Fetch a #

duplicate :: Fetch element -> IO (Fetch element, Fetch element) Source #

list :: IORef [element] -> Fetch element Source #