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.
Synopsis
- 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 | |
|
Instances
Functor ParseOptions Source # | |
Defined in Data.Svfactor.Parse.Options fmap :: (a -> b) -> ParseOptions a -> ParseOptions b # (<$) :: a -> ParseOptions b -> ParseOptions a # | |
HasHeadedness (ParseOptions s) Source # | |
Defined in Data.Svfactor.Parse.Options headedness :: Lens' (ParseOptions s) Headedness Source # | |
HasSeparator (ParseOptions s) Source # | |
Defined in Data.Svfactor.Parse.Options | |
HasParseOptions (ParseOptions a) (ParseOptions b) a b Source # | |
Defined in Data.Svfactor.Parse.Options parseOptions :: Lens (ParseOptions a) (ParseOptions b) (ParseOptions a) (ParseOptions b) Source # encodeString :: Lens (ParseOptions a) (ParseOptions b) (String -> a) (String -> b) Source # endOnBlankLine :: Lens (ParseOptions a) (ParseOptions b) Bool Bool 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 #
Instances
HasParseOptions (ParseOptions a) (ParseOptions b) a b Source # | |
Defined in Data.Svfactor.Parse.Options parseOptions :: Lens (ParseOptions a) (ParseOptions b) (ParseOptions a) (ParseOptions b) Source # encodeString :: Lens (ParseOptions a) (ParseOptions b) (String -> a) (String -> b) Source # endOnBlankLine :: Lens (ParseOptions a) (ParseOptions b) Bool Bool Source # |
class HasSeparator c where Source #
Classy lens for Separator
Instances
HasSeparator Char Source # | |
HasSeparator (Sv s) Source # | |
HasSeparator (ParseOptions s) Source # | |
Defined in Data.Svfactor.Parse.Options |
class HasHeadedness c where Source #
Classy lens for Headedness
headedness :: Lens' c Headedness Source #
Instances
HasHeadedness Headedness Source # | |
Defined in Data.Svfactor.Structure.Headedness | |
HasHeadedness (ParseOptions s) Source # | |
Defined in Data.Svfactor.Parse.Options headedness :: Lens' (ParseOptions s) 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
.