yaml-0.11.4.0: Support for parsing and rendering YAML documents.
Safe HaskellNone
LanguageHaskell2010

Data.Yaml.Internal

Synopsis

Documentation

data ParseException #

Instances

Instances details
Show ParseException # 
Instance details

Defined in Data.Yaml.Internal

Methods

showsPrec :: Int -> ParseException -> ShowS

show :: ParseException -> String

showList :: [ParseException] -> ShowS

Exception ParseException # 
Instance details

Defined in Data.Yaml.Internal

Methods

toException :: ParseException -> SomeException

fromException :: SomeException -> Maybe ParseException

displayException :: ParseException -> String

prettyPrintParseException :: ParseException -> String #

Alternative to show to display a ParseException on the screen. Instead of displaying the data constructors applied to their arguments, a more textual output is returned. For example, instead of printing:

InvalidYaml (Just (YamlParseException {yamlProblem = "did not find expected ',' or '}'", yamlContext = "while parsing a flow mapping", yamlProblemMark = YamlMark {yamlIndex = 42, yamlLine = 2, yamlColumn = 12}})))

It looks more pleasant to print:

YAML parse exception at line 2, column 12,
while parsing a flow mapping:
did not find expected ',' or '}'

Since 0.8.11

data Warning #

Constructors

DuplicateKey JSONPath 

Instances

Instances details
Eq Warning # 
Instance details

Defined in Data.Yaml.Internal

Methods

(==) :: Warning -> Warning -> Bool

(/=) :: Warning -> Warning -> Bool

Show Warning # 
Instance details

Defined in Data.Yaml.Internal

Methods

showsPrec :: Int -> Warning -> ShowS

show :: Warning -> String

showList :: [Warning] -> ShowS

parse :: ReaderT JSONPath (ConduitM Event o Parse) Value #

decodeHelper :: FromJSON a => ConduitM () Event Parse () -> IO (Either ParseException ([Warning], Either String a)) #

decodeHelper_ :: FromJSON a => ConduitM () Event Parse () -> IO (Either ParseException ([Warning], a)) #

textToScientific :: Text -> Either String Scientific #

stringScalar :: StringStyle -> Maybe Text -> Text -> Event #

Encodes a string with the supplied style. This function handles the empty string case properly to avoid https://github.com/snoyberg/yaml/issues/24

Since: 0.11.2.0

defaultStringStyle :: StringStyle #

Since: 0.11.2.0

isSpecialString :: Text -> Bool #

Determine whether a string must be quoted in YAML and can't appear as plain text. Useful if you want to use setStringStyle.

Since: 0.10.2.0

specialStrings :: HashSet Text #

Strings which must be escaped so as not to be treated as non-string scalars.

Since: 0.8.32

isNumeric :: Text -> Bool #

Since: 0.8.32

objToStream :: ToJSON a => StringStyle -> a -> [Event] #

Encode a value as a YAML document stream.

Since: 0.11.2.0

objToEvents :: ToJSON a => StringStyle -> a -> [Event] -> [Event] #

Encode a value as a list of Events.

Since: 0.11.2.0