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

Safe HaskellNone
LanguageHaskell2010

Potoki.Core.Produce

Contents

Synopsis

Documentation

newtype Produce element Source #

Passive producer of elements with support for early termination and resource management.

Constructors

Produce (Acquire (Fetch element)) 

list :: [input] -> Produce input Source #

transform :: Transform input output -> Produce input -> Produce output Source #

vector :: Vector input -> Produce input Source #

hashMapRows :: HashMap a b -> Produce (a, b) Source #

fileBytes :: FilePath -> Produce (Either IOException ByteString) Source #

Read from a file by path.

  • Exception-free
  • Automatic resource management

fileBytesAtOffset :: FilePath -> Int -> Produce (Either IOException ByteString) Source #

Read from a file by path.

  • Exception-free
  • Automatic resource management

fileText :: FilePath -> Produce (Either IOException Text) Source #

Read from a file by path.

  • Exception-free
  • Automatic resource management

stdinBytes :: Produce (Either IOException ByteString) Source #

directoryContents :: FilePath -> Produce (Either IOException FilePath) Source #

Sorted subpaths of the directory.

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

Read from MVar. Nothing gets interpreted as the end of input.

infiniteMVar :: MVar element -> Produce element Source #

Read from MVar. Never stops.

lazyByteString :: ByteString -> Produce ByteString Source #

Orphan instances

Monad Produce Source # 

Methods

(>>=) :: Produce a -> (a -> Produce b) -> Produce b

(>>) :: Produce a -> Produce b -> Produce b

return :: a -> Produce a

fail :: String -> Produce a

Functor Produce Source # 

Methods

fmap :: (a -> b) -> Produce a -> Produce b

(<$) :: a -> Produce b -> Produce a

Applicative Produce Source # 

Methods

pure :: a -> Produce a

(<*>) :: Produce (a -> b) -> Produce a -> Produce b

(*>) :: Produce a -> Produce b -> Produce b

(<*) :: Produce a -> Produce b -> Produce a

Alternative Produce Source # 

Methods

empty :: Produce a

(<|>) :: Produce a -> Produce a -> Produce a

some :: Produce a -> Produce [a]

many :: Produce a -> Produce [a]

MonadIO Produce Source # 

Methods

liftIO :: IO a -> Produce a