sv-svfactor-0.2: sv-core + svfactor

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

Data.Sv.Svfactor

Description

 
Synopsis

Documentation

parseDecode :: Decode ByteString (SpacedField ByteString) a -> ParseOptions ByteString -> ByteString -> DecodeValidation ByteString [a] Source #

Parse a ByteString as an Sv and then decode it using the given decoder.

This version uses trifecta for parsing.

parseDecode' :: SvParser s -> Decode s (SpacedField s) a -> ParseOptions s -> s -> DecodeValidation s [a] Source #

Parse a ByteString as an Sv and then decode it using the given decoder.

This version lets you control which parser is used.

decodeSvfactor :: Decode s (SpacedField s) a -> Sv s -> DecodeValidation s [a] Source #

Decode from an Sv using the given decoder

ignoreSpaces :: Decode e (Field s) a -> Decode e (SpacedField s) a Source #

Promote a decoder that works on fields to one that works on fields with optional surrounding spaces, by ignoring the spaces.

ignoreField :: Decode e s a -> Decode e (Field s) a Source #

Promote a decoder to work on a field by ignoring the structure of the field.

ignoreSpacedField :: Decode e s a -> Decode e (SpacedField s) a Source #

Promote a decoder to work on a spaced field by ignoring the spacing and the field.

treatAsQuoted :: Decode e (Field s) a -> Decode e s a Source #

Demote a decoder that works on fields to one that ignores the field structure by always passing in a dummy set of double quotes.

treatAsQuotedUnspaced :: Decode e (SpacedField s) a -> Decode e s a Source #

Demote a decoder that works on spaced fields to one that ignores the spacing and field structure by always passing in a dummy set of double quotes and empty spacing.

field :: Decode e (SpacedField s) (Field s) Source #

Get the Field from a SpacedField

contents :: Decode e (SpacedField s) s Source #

Get the contents from a SpacedField