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

Safe HaskellNone
LanguageHaskell2010

Siphon.Internal.Text

Synopsis

Documentation

escapeAlways :: Text -> Escaped Text Source

This implementation is definitely suboptimal. A better option (which would waste a little space but would be much faster) would be to build the new text by writing to a buffer directly.

sepByDelim1' Source

Arguments

:: Parser a 
-> Char

Field delimiter

-> Parser [a] 

Specialized version of sepBy1' which is faster due to not accepting an arbitrary separator.

sepByEndOfLine1' :: Parser a -> Parser [a] Source

Specialized version of sepBy1' which is faster due to not accepting an arbitrary separator.

row Source

Arguments

:: Char

Field delimiter

-> Parser (Vector Text) 

Parse a record, not including the terminating line separator. The terminating line separate is not included as the last record in a CSV file is allowed to not have a terminating line separator. You most likely want to use the endOfLine parser in combination with this parser.

rowNoNewline Source

Arguments

:: Char

Field delimiter

-> Parser (Vector Text) 

field :: Char -> Parser Text Source

Parse a field. The field may be in either the escaped or non-escaped format. The return value is unescaped.

(<$!>) :: Monad m => (a -> b) -> m a -> m b infixl 4 Source

A strict version of <$> for monads.

liftM2' :: Monad m => (a -> b -> c) -> m a -> m b -> m c Source

A version of liftM2 that is strict in the result of its first action.

endOfLine :: Parser () Source

Match either a single newline character '\n', or a carriage return followed by a newline character "\r\n", or a single carriage return '\r'.