Copyright | (C) CSIRO 2017-2018 |
---|---|
License | BSD3 |
Maintainer | George Wilson <george.wilson@data61.csiro.au> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Configuration to tell the parser what your file looks like.
- data ParseOptions s = ParseOptions {
- _parseSeparator :: Separator
- _headedness :: Headedness
- _endOnBlankLine :: Bool
- _encodeString :: String -> s
- class (HasSeparator s, HasHeadedness s) => HasParseOptions s t a b | s -> a, t -> b, s b -> t, t a -> s where
- class HasSeparator c where
- class HasHeadedness c where
- defaultParseOptions :: ParseOptions ByteString
- defaultHeadedness :: Headedness
- defaultSeparator :: Separator
Documentation
data ParseOptions s Source #
An ParseOptions
informs the parser how to parse your file. The type
parameter will be some sort of string; often ByteString
.
A default is provided as defaultParseOptions
, seen below.
ParseOptions | |
|
Functor ParseOptions Source # | |
HasSeparator (ParseOptions s) Source # | |
HasHeadedness (ParseOptions s) Source # | |
HasParseOptions (ParseOptions a) (ParseOptions b) a b Source # | |
class (HasSeparator s, HasHeadedness s) => HasParseOptions s t a b | s -> a, t -> b, s b -> t, t a -> s where Source #
Classy lenses for ParseOptions
parseOptions :: Lens s t (ParseOptions a) (ParseOptions b) Source #
encodeString :: Lens s t (String -> a) (String -> b) Source #
endOnBlankLine :: s ~ t => Lens s t Bool Bool Source #
endOnBlankLine :: (s ~ t, a ~ b) => Lens s t Bool Bool Source #
HasParseOptions (ParseOptions a) (ParseOptions b) a b Source # | |
class HasSeparator c where Source #
Classy lens for Separator
class HasHeadedness c where Source #
Classy lens for Headedness
headedness :: Lens' c Headedness Source #
defaultParseOptions :: ParseOptions ByteString Source #
defaultParseOptions
is used to parse a CSV file featuring a header row, using
Trifecta as the parsing library. It uses UTF-8 ByteString
s
defaultHeadedness :: Headedness Source #
The default is that a header is present.
defaultSeparator :: Separator Source #
The default separator. Alias for comma
.