Copyright | (c) Marcin Mrotek, 2015 |
---|---|
License | BSD3 |
Maintainer | marcin.jan.mrotek@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Parse key-value pairs.
- parseKeyValues :: forall m f rs r. (Given Delimiter, Monad m, Record rs) => KeyValueOptions m f rs -> Lines m r -> m (Rec (WithKeyValueError :. f) rs, r)
- foldHeader :: (Monad m, Record rs) => Producer (Rec (WithKeyValueError :. f) rs) m r -> m (Rec (WithKeyValueError :. f) rs, r)
- joinRecs :: Rec (WithKeyValueError :. f) rs -> Rec (WithKeyValueError :. f) rs -> Rec (WithKeyValueError :. f) rs
- class Record rs
- data KeyValueError
Documentation
:: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (r :: *). (Given Delimiter, Monad m, Record rs) | |
=> KeyValueOptions m f rs | Options |
-> Lines m r | Stream of lines |
-> m (Rec (WithKeyValueError :. f) rs, r) |
Parse lines into a stream of records with at most one AccSuccess
field.
foldHeader :: (Monad m, Record rs) => Producer (Rec (WithKeyValueError :. f) rs) m r -> m (Rec (WithKeyValueError :. f) rs, r) Source
Fold a stream of key-value records into a single record.
joinRecs :: Rec (WithKeyValueError :. f) rs -> Rec (WithKeyValueError :. f) rs -> Rec (WithKeyValueError :. f) rs Source
Join two Rec
s, replacing missing values with successes and accumulating failures.
class Record rs
data KeyValueError Source
An error that occured during the parsing of the header.
MissingValue | A value is missing in the header. |
MultipleValues | A value is given multiple times. |
ValueParsingError String | Parsing error as returned by Data.Text.Lazy.Read. |