potoki-0.9.1: Simple streaming in IO

Safe HaskellNone
LanguageHaskell2010

Potoki.Transform

Contents

Synopsis

Documentation

data Transform input output :: * -> * -> * #

Potoki integration

consume :: Consume input output -> Transform input output #

produce :: (input -> Produce output) -> Transform input output #

Basics

take :: Int -> Transform input input #

takeWhile :: (input -> Bool) -> Transform input input Source #

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

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

just :: Transform (Maybe input) input Source #

distinctBy :: (Eq comparable, Hashable comparable) => (element -> comparable) -> Transform element element Source #

distinct :: (Eq element, Hashable element) => Transform element element Source #

executeIO :: Transform (IO a) a #

Execute the IO action.

mapInIO :: (a -> IO b) -> Transform a b Source #

state :: (a -> State s [b]) -> s -> Transform a b Source #

Parsing

parseBytes :: Parser parsed -> Transform ByteString (Either Text parsed) Source #

Lift an Attoparsec ByteString parser.

parseText :: Parser parsed -> Transform Text (Either Text parsed) Source #

Lift an Attoparsec Text parser.

Concurrency

bufferize :: Int -> Transform element element Source #

concurrently :: Int -> Transform input output -> Transform input output Source #

Execute the transform on the specified amount of threads. The order of the outputs produced is indiscriminate.

async :: Int -> Transform input input Source #

A transform, which fetches the inputs asynchronously on the specified number of threads.

File IO