sv-0.1: Encode and decode separated values (CSV, PSV, ...)

Copyright(C) CSIRO 2017-2018
LicenseBSD3
MaintainerGeorge Wilson <george.wilson@data61.csiro.au>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Sv.Parse.Options

Description

Configuration to tell the parser what your file looks like.

Synopsis

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.

Constructors

ParseOptions 

Fields

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

Minimal complete definition

parseOptions

Methods

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 #

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 ByteStrings

defaultHeadedness :: Headedness Source #

The default is that a header is present.

defaultSeparator :: Separator Source #

The default separator. Alias for comma.