yaml-light-0.1: A light-weight wrapper with utility functions around HsSyck

Portabilityportable
Stabilityprovisional
Maintainermichael <dot> ilseman <at> gmail <dot> com

Data.Yaml.YamlLight

Contents

Description

A light-weight wrapper with utility functions around HsSyck

Synopsis

YamlLight data type

YamlLight versions of Syck functions

parseYaml :: String -> IO YamlLightSource

Parse a regular Haskell string

parseYamlFile :: String -> IO YamlLightSource

Given a file name, parse contents of file

parseYamlBytes :: ByteString -> IO YamlLightSource

Parse a ByteString buffer (this is faster)

YamlLight utility functions

fromYamlNode :: YamlNode -> YamlLightSource

Convert a Syck YamlNode to a YamlLight

lookupYL :: YamlLight -> YamlLight -> Maybe YamlLightSource

Lookup the key's corresponding value in a Map. Returns Nothing if the YamlLight is not a map, or if the key is not found

lookupYLWith :: (YamlLight -> Bool) -> YamlLight -> Maybe YamlLightSource

General form of lookup. Will return the first element that satisfies predicate p, otherwise Nothing

Extractors

unSeq :: YamlLight -> Maybe [YamlLight]Source

Get the contents of a sequence

unMap :: YamlLight -> Maybe (Map YamlLight YamlLight)Source

Get the contents of a map

unStr :: YamlLight -> Maybe ByteStringSource

Get the contents of a string