siphon-0.2: Generic types and functions for columnar encoding and decoding

Safe HaskellNone
LanguageHaskell2010

Siphon.Decoding

Synopsis

Documentation

convertDecodeError :: String -> Either (Producer ByteString m ()) () -> Maybe (DecodingRowError f c) Source

This is a convenience function for working with pipes-text. It will convert a UTF-8 decoding error into a DecodingRowError, so the pipes can be properly chained together.

headlessPipe :: Monad m => Siphon c -> Decoding Headless c a -> Pipe c a m (DecodingRowError Headless c) Source

This is seldom useful but is included for completeness.

uncheckedPipe Source

Arguments

:: Monad m 
=> Int

expected length of each row

-> Int

index of first row, usually zero or one

-> Siphon c 
-> Decoding (Indexed f) c a 
-> Maybe c 
-> Pipe c a m (DecodingRowError f c) 

consumeGeneral :: Monad m => Int -> Siphon c -> (Int -> [String] -> String -> e) -> Consumer' c m (Either e (Vector c, Maybe c)) Source

pipeGeneral Source

Arguments

:: Monad m 
=> Int

index of first row, usually zero or one

-> Siphon c 
-> (Int -> [String] -> String -> e) 
-> (Int -> Vector c -> Either e a) 
-> Maybe c

leftovers that should be handled first

-> Pipe c a m e 

awaitSkip :: Monad m => (a -> Bool) -> Consumer' a m a Source