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 |
Synopsis
- parseDecode :: Decode ByteString (SpacedField ByteString) a -> ParseOptions ByteString -> ByteString -> DecodeValidation ByteString [a]
- parseDecode' :: SvParser s -> Decode s (SpacedField s) a -> ParseOptions s -> s -> DecodeValidation s [a]
- decodeSvfactor :: Decode s (SpacedField s) a -> Sv s -> DecodeValidation s [a]
- ignoreSpaces :: Decode e (Field s) a -> Decode e (SpacedField s) a
- ignoreField :: Decode e s a -> Decode e (Field s) a
- ignoreSpacedField :: Decode e s a -> Decode e (SpacedField s) a
- treatAsQuoted :: Decode e (Field s) a -> Decode e s a
- treatAsQuotedUnspaced :: Decode e (SpacedField s) a -> Decode e s a
- spacedField :: Decode e (SpacedField s) (SpacedField s)
- field :: Decode e (SpacedField s) (Field s)
- contents :: Decode e (SpacedField s) s
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.
spacedField :: Decode e (SpacedField s) (SpacedField s) Source #
Alias for contents
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