siphon-0.6: Encode and decode CSV files

Safe HaskellNone
LanguageHaskell2010

Siphon.Decoding

Synopsis

Documentation

headlessPipe :: Monad m => Siphon c -> Decolonnade Headless c a -> Pipe c a m (DecolonnadeRowError Headless c) Source #

This is seldom useful but is included for completeness.

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 

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

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

headed :: content -> (content -> Either String a) -> Decolonnade Headed content a Source #

headless :: (content -> Either String a) -> Decolonnade Headless content a Source #

indexed :: Int -> (content -> Either String a) -> Decolonnade (Indexed Headless) content a Source #