Copyright | (c) Marcin Mrotek 2015 |
---|---|
License | BSD3 |
Maintainer | marcin.jan.mrotek@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Helper classes and functions.
- parseLine :: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (r :: *). (Monad m, Given Delimiter) => Rec (CellParser m f) rs -> Line m r -> Producer (Rec (WithCsvError :. f) rs) m r
- parseCells :: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (x :: *). Monad m => Rec (CellParser m f) rs -> Cells m x -> Producer (Rec (WithCsvError :. f) rs) m x
- validateCell :: (Either String :. f) a -> (Validation [CsvError] :. f) a
- buildFromCells :: Monad m => Rec (CellParser m f) (r ': rs) -> Cells m x -> m (Rec (WithCsvError :. f) rs -> Rec (WithCsvError :. f) (r ': rs), Cells m x)
- fromCells :: Monad m => Rec (CellParser m f) rs -> Cells m x -> m (Rec (WithCsvError :. f) rs, x)
Documentation
parseLine :: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (r :: *). (Monad m, Given Delimiter) => Rec (CellParser m f) rs -> Line m r -> Producer (Rec (WithCsvError :. f) rs) m r Source #
Parse a single row from a stream of text, discard the remaining characters.
:: forall (m :: * -> *) (f :: k -> *) (rs :: [k]) (x :: *). Monad m | |
=> Rec (CellParser m f) rs | Parser record. |
-> Cells m x | Stream of cells. |
-> Producer (Rec (WithCsvError :. f) rs) m x |
Parse a row of cells and pack it into a one-shot Producer
.
validateCell :: (Either String :. f) a -> (Validation [CsvError] :. f) a Source #
:: Monad m | |
=> Rec (CellParser m f) (r ': rs) | Parser record. |
-> Cells m x | Stream of cells. |
-> m (Rec (WithCsvError :. f) rs -> Rec (WithCsvError :. f) (r ': rs), Cells m x) |
:: Monad m | |
=> Rec (CellParser m f) rs | Parser record. |
-> Cells m x | Stream of cells. |
-> m (Rec (WithCsvError :. f) rs, x) |
Parse a row of cells. For more information about parsing with Pipes, see Pipes.Parse.Tutorial.