Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Consume input output
- transform :: Transform input1 input2 -> Consume input2 output -> Consume input1 output
- count :: Consume input Int
- sum :: Num num => Consume num num
- head :: Consume input (Maybe input)
- last :: Consume input (Maybe input)
- list :: Consume input [input]
- reverseList :: Consume input [input]
- vector :: Consume input (Vector input)
- concat :: (Semigroup monoid, Monoid monoid) => Consume monoid monoid
- fold :: Fold input output -> Consume input output
- foldInIO :: FoldM IO input output -> Consume input output
- folding :: Fold a b -> Consume a c -> Consume a (b, c)
- foldingInIO :: FoldM IO a b -> Consume a c -> Consume a (b, c)
- execState :: (a -> State s b) -> s -> Consume a s
- writeBytesToStdout :: Consume ByteString ()
- writeBytesToFile :: FilePath -> Consume ByteString (Either IOException ())
- writeBytesToFileWithoutBuffering :: FilePath -> Consume ByteString (Either IOException ())
- appendBytesToFile :: FilePath -> Consume ByteString (Either IOException ())
- deleteFiles :: Consume FilePath (Either IOException ())
- printBytes :: Consume ByteString ()
- printText :: Consume Text ()
- printString :: Consume String ()
- parseBytes :: Parser output -> Consume ByteString (Either Text output)
- parseText :: Parser output -> Consume Text (Either Text output)
- concurrently :: NFData b => Int -> Consume a b -> Consume b c -> Consume a c
Documentation
Active consumer of input into output. Sort of like a reducer in Map/Reduce.
Automates the management of resources.
reverseList :: Consume input [input] #
A faster alternative to "list", which however constructs the list in the reverse order.
writeBytesToStdout :: Consume ByteString () #
writeBytesToFile :: FilePath -> Consume ByteString (Either IOException ()) #
Overwrite a file.
- Exception-free
- Automatic resource management
writeBytesToFileWithoutBuffering :: FilePath -> Consume ByteString (Either IOException ()) #
A more efficient implementation than just writing to file without buffering. It uses an explicit buffer of input chunks and flushes all the chunks that have been so far aggregated at once.
appendBytesToFile :: FilePath -> Consume ByteString (Either IOException ()) #
Append to a file.
- Exception-free
- Automatic resource management
deleteFiles :: Consume FilePath (Either IOException ()) #
printBytes :: Consume ByteString () #
printString :: Consume String () #
parseBytes :: Parser output -> Consume ByteString (Either Text output) #