potoki-core-2.2.1: 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)) 

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

maybeRef :: IORef (Maybe a) -> Fetch a Source #

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

firstCachingSecond :: IORef b -> Fetch (a, b) -> Fetch a Source #

bothFetchingFirst :: IORef b -> Fetch a -> Fetch (a, b) 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 #

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

handleBytes :: Handle -> Fetch (Either IOException ByteString) Source #

handleBytesWithChunkSize :: Int -> Handle -> Fetch (Either IOException ByteString) Source #

handleText :: Handle -> Fetch (Either IOException Text) 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 #

lazyByteStringRef :: IORef ByteString -> Fetch ByteString Source #

Orphan instances

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]