pipes-key-value-csv-0.4.0.1: 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

Contents

Description

Parse CSV files with key-value headers.

Synopsis

Documentation

breakLines :: Monad m => (Text -> Bool) -> Lines m r -> Lines m (Lines m r) Source #

Break a stream of lines into two parts, on a line that satisfies the given predicate. All input lines up to the breaking one will be fully read, and each (not including the breaking one) will be re-yielded.

parseKeyValueCsv :: forall m f g hs rs r. (Monad m, Record hs) => Options m f g hs rs -> Producer Text m r -> m (Rec (WithKeyValueError :. f) hs, Producer (Rec (WithCsvError :. g) rs) m r) Source #

Read a CSV file preceded by key-value pairs.

class Record k rs where #

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

Methods

proxyRecord :: Rec k (Proxy k) rs #

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 #

Re-exports

data Validation e a Source #

Constructors

Success a 
Failure e 

Instances

Bifunctor Validation Source # 

Methods

bimap :: (a -> b) -> (c -> d) -> Validation a c -> Validation b d #

first :: (a -> b) -> Validation a c -> Validation b c #

second :: (b -> c) -> Validation a b -> Validation a c #

Bitraversable Validation Source # 

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Validation a b -> f (Validation c d) #

Bifoldable Validation Source # 

Methods

bifold :: Monoid m => Validation m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Validation a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Validation a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Validation a b -> c #

Swapped Validation Source # 

Methods

swapped :: (Profunctor p, Functor f) => p (Validation b a) (f (Validation d c)) -> p (Validation a b) (f (Validation c d)) #

Functor (Validation e) Source # 

Methods

fmap :: (a -> b) -> Validation e a -> Validation e b #

(<$) :: a -> Validation e b -> Validation e a #

Semigroup e => Applicative (Validation e) Source # 

Methods

pure :: a -> Validation e a #

(<*>) :: Validation e (a -> b) -> Validation e a -> Validation e b #

(*>) :: Validation e a -> Validation e b -> Validation e b #

(<*) :: Validation e a -> Validation e b -> Validation e a #

Foldable (Validation e) Source # 

Methods

fold :: Monoid m => Validation e m -> m #

foldMap :: Monoid m => (a -> m) -> Validation e a -> m #

foldr :: (a -> b -> b) -> b -> Validation e a -> b #

foldr' :: (a -> b -> b) -> b -> Validation e a -> b #

foldl :: (b -> a -> b) -> b -> Validation e a -> b #

foldl' :: (b -> a -> b) -> b -> Validation e a -> b #

foldr1 :: (a -> a -> a) -> Validation e a -> a #

foldl1 :: (a -> a -> a) -> Validation e a -> a #

toList :: Validation e a -> [a] #

null :: Validation e a -> Bool #

length :: Validation e a -> Int #

elem :: Eq a => a -> Validation e a -> Bool #

maximum :: Ord a => Validation e a -> a #

minimum :: Ord a => Validation e a -> a #

sum :: Num a => Validation e a -> a #

product :: Num a => Validation e a -> a #

Traversable (Validation e) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Validation e a -> f (Validation e b) #

sequenceA :: Applicative f => Validation e (f a) -> f (Validation e a) #

mapM :: Monad m => (a -> m b) -> Validation e a -> m (Validation e b) #

sequence :: Monad m => Validation e (m a) -> m (Validation e a) #

(Monoid e, Semigroup e) => Alternative (Validation e) Source # 

Methods

empty :: Validation e a #

(<|>) :: Validation e a -> Validation e a -> Validation e a #

some :: Validation e a -> Validation e [a] #

many :: Validation e a -> Validation e [a] #

Alt (Validation e) Source # 

Methods

(<!>) :: Validation e a -> Validation e a -> Validation e a #

some :: Applicative (Validation e) => Validation e a -> Validation e [a] #

many :: Applicative (Validation e) => Validation e a -> Validation e [a] #

Semigroup e => Apply (Validation e) Source # 

Methods

(<.>) :: Validation e (a -> b) -> Validation e a -> Validation e b #

(.>) :: Validation e a -> Validation e b -> Validation e b #

(<.) :: Validation e a -> Validation e b -> Validation e a #

(Eq e, Eq a) => Eq (Validation e a) Source # 

Methods

(==) :: Validation e a -> Validation e a -> Bool #

(/=) :: Validation e a -> Validation e a -> Bool #

(Data a, Data e) => Data (Validation e a) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Validation e a -> c (Validation e a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Validation e a) #

toConstr :: Validation e a -> Constr #

dataTypeOf :: Validation e a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Validation e a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d b. (Data d, Data b) => c (t d b)) -> Maybe (c (Validation e a)) #

gmapT :: (forall b. Data b => b -> b) -> Validation e a -> Validation e a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Validation e a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Validation e a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Validation e a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Validation e a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Validation e a -> m (Validation e a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Validation e a -> m (Validation e a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Validation e a -> m (Validation e a) #

(Ord e, Ord a) => Ord (Validation e a) Source # 

Methods

compare :: Validation e a -> Validation e a -> Ordering #

(<) :: Validation e a -> Validation e a -> Bool #

(<=) :: Validation e a -> Validation e a -> Bool #

(>) :: Validation e a -> Validation e a -> Bool #

(>=) :: Validation e a -> Validation e a -> Bool #

max :: Validation e a -> Validation e a -> Validation e a #

min :: Validation e a -> Validation e a -> Validation e a #

(Show e, Show a) => Show (Validation e a) Source # 

Methods

showsPrec :: Int -> Validation e a -> ShowS #

show :: Validation e a -> String #

showList :: [Validation e a] -> ShowS #

Generic (Validation e a) Source # 

Associated Types

type Rep (Validation e a) :: * -> * #

Methods

from :: Validation e a -> Rep (Validation e a) x #

to :: Rep (Validation e a) x -> Validation e a #

Semigroup e => Semigroup (Validation e a) Source # 

Methods

(<>) :: Validation e a -> Validation e a -> Validation e a #

sconcat :: NonEmpty (Validation e a) -> Validation e a #

stimes :: Integral b => b -> Validation e a -> Validation e a #

Monoid e => Monoid (Validation e a) Source # 

Methods

mempty :: Validation e a #

mappend :: Validation e a -> Validation e a -> Validation e a #

mconcat :: [Validation e a] -> Validation e a #

type Rep (Validation e a) Source # 
type Rep (Validation e a) = D1 (MetaData "Validation" "Data.Validation" "pipes-key-value-csv-0.4.0.1-GlMM7cnp6H9FTxZfFOOGrX" False) ((:+:) (C1 (MetaCons "Success" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) (C1 (MetaCons "Failure" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 e))))