potoki-0.6.4: Simple streaming in IO

Safe HaskellNone
LanguageHaskell2010

Potoki.Transform

Contents

Synopsis

Documentation

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

Instances

Arrow Transform 

Methods

arr :: (b -> c) -> Transform b c #

first :: Transform b c -> Transform (b, d) (c, d) #

second :: Transform b c -> Transform (d, b) (d, c) #

(***) :: Transform b c -> Transform b' c' -> Transform (b, b') (c, c') #

(&&&) :: Transform b c -> Transform b c' -> Transform b (c, c') #

ArrowChoice Transform 

Methods

left :: Transform b c -> Transform (Either b d) (Either c d) #

right :: Transform b c -> Transform (Either d b) (Either d c) #

(+++) :: Transform b c -> Transform b' c' -> Transform (Either b b') (Either c c') #

(|||) :: Transform b d -> Transform c d -> Transform (Either b c) d #

Profunctor Transform 

Methods

dimap :: (a -> b) -> (c -> d) -> Transform b c -> Transform a d #

lmap :: (a -> b) -> Transform b c -> Transform a c #

rmap :: (b -> c) -> Transform a b -> Transform a c #

(#.) :: Coercible * c b => (b -> c) -> Transform a b -> Transform a c #

(.#) :: Coercible * b a => Transform b c -> (a -> b) -> Transform a c #

Strong Transform 

Methods

first' :: Transform a b -> Transform (a, c) (b, c) #

second' :: Transform a b -> Transform (c, a) (c, b) #

Choice Transform 

Methods

left' :: Transform a b -> Transform (Either a c) (Either b c) #

right' :: Transform a b -> Transform (Either c a) (Either c b) #

Category * Transform 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

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 #

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 #

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.

File IO