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

Safe HaskellNone
LanguageHaskell2010

Potoki.Core.Fetch

Contents

Synopsis

Documentation

newtype Fetch element Source #

Passive producer of elements.

Constructors

Fetch (IO (Maybe element)) 
Instances
Functor Fetch # 
Instance details

Defined in Potoki.Core.Fetch

Methods

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

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

Applicative Fetch # 
Instance details

Defined in Potoki.Core.Fetch

Methods

pure :: a -> Fetch a #

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

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

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

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

Alternative Fetch # 
Instance details

Defined in Potoki.Core.Fetch

Methods

empty :: Fetch a #

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

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

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

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

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

rightHandlingLeft :: (left -> IO ()) -> Fetch (Either left right) -> Fetch right Source #

rightCachingLeft :: IORef (Maybe left) -> Fetch (Either left right) -> Fetch right Source #

eitherFetchingRight :: IORef (Maybe left) -> Fetch right -> Fetch (Either left right) Source #

signaling :: IO () -> IO () -> Fetch a -> Fetch a Source #

mapFilter :: (input -> Maybe output) -> Fetch input -> Fetch output Source #

filter :: (input -> Bool) -> Fetch input -> Fetch input Source #

just :: Fetch (Maybe element) -> Fetch element Source #

takeWhile :: (element -> Bool) -> Fetch element -> Fetch element Source #

infiniteMVar :: MVar element -> Fetch element Source #

finiteMVar :: MVar (Maybe element) -> Fetch element Source #

vector :: IORef Int -> Vector element -> Fetch element Source #

handlingElements :: (element -> IO ()) -> Fetch element -> Fetch element Source #

Orphan instances

Functor Fetch Source # 
Instance details

Methods

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

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

Applicative Fetch Source # 
Instance details

Methods

pure :: a -> Fetch a #

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

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

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

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

Alternative Fetch Source # 
Instance details

Methods

empty :: Fetch a #

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

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

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