pipes-key-value-csv-0.4.0.2: Streaming processing of CSV files preceded by key-value pairs.

Copyright(c) Marcin Mrotek 2015
LicenseBSD3
Maintainermarcin.jan.mrotek@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Pipes.KeyValueCsv.Internal.KeyValue

Description

 

Synopsis

Documentation

drawCell :: Monad m => StateT (Cells m r) m (Maybe Text) Source #

Draw a single cell from a FreeT-delimited stream.

missing :: forall f rs. Record rs => Rec (WithKeyValueError :. f) rs Source #

An empty record filled with Failure MissingValue.

parseKeyValue Source #

Arguments

:: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (r :: *). (Given Delimiter, Monad m, Record rs) 
=> Rec (CellParser m f) rs

Parser record.

-> Rec (Const Text) rs

Key name record.

-> Set Text

Name set.

-> Line m r

Line to parse.

-> Producer (Rec (WithKeyValueError :. f) rs) m r 

Parse a single line into an one-shot producer of records with at most one Success field.

fromKeyValues Source #

Arguments

:: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (x :: *). Monad m 
=> (Text, Producer Text m x)

Key-value pair.

-> Rec (CellParser m f) rs

Parser record.

-> Rec (Const Text) rs

Key name record.

-> Rec (WithKeyValueError :. f) rs

Current parsing result.

-> m (Rec (WithKeyValueError :. f) rs, x) 

Parse a key-value pair into a record with at most one Success field.

class Record k rs #

Create a dummy record parametrized by Proxy. The class is named Record to signify that every possible type list is its instance.

Minimal complete definition

proxyRecord

Instances

Record k ([] k) 

Methods

proxyRecord :: Rec [k] (Proxy [k]) rs #

Record k rs => Record k ((:) k r rs) 

Methods

proxyRecord :: Rec ((k ': r) rs) (Proxy ((k ': r) rs)) rs #