Data.Yaml.Syck

HsSyck-0.50: Fast, lightweight YAML loader and dumper

Safe Haskell | None

Data.Yaml.Syck

Synopsis

- parseYaml :: String -> IO YamlNode
- emitYaml :: YamlNode -> IO String
- parseYamlFile :: String -> IO YamlNode
- emitYamlFile :: FilePath -> YamlNode -> IO ()
- parseYamlBytes :: Buf -> IO YamlNode
- emitYamlBytes :: YamlNode -> IO Buf
- data YamlNode = MkNode {
  - n_id :: !SYMID
  - n_elem :: !YamlElem
  - n_tag :: !YamlTag
  - n_anchor :: !YamlAnchor
  }
- data YamlElem
  - = EMap [(YamlNode, YamlNode)]
  - | ESeq [YamlNode]
  - | EStr !Buf
  - | ENil
- data YamlAnchor
  - = AAnchor !Int
  - | AReference !Int
  - | ASingleton
- tagNode :: YamlTag -> YamlNode -> YamlNode
- nilNode :: YamlNode
- mkNode :: YamlElem -> YamlNode
- mkTagNode :: String -> YamlElem -> YamlNode
- mkTagStrNode :: String -> String -> YamlNode
- type SYMID = CULong
- packBuf :: String -> Buf
- unpackBuf :: Buf -> String

# Documentation

parseYaml :: String -> IO YamlNode

Parse a regular Haskell string

emitYaml :: YamlNode -> IO String

Dump a YAML node into a regular Haskell string

parseYamlFile :: String -> IO YamlNode

Given a file name, parse contents of file

emitYamlFile :: FilePath -> YamlNode -> IO ()

Given a file name, dump a YAML node into that file

parseYamlBytes :: Buf -> IO YamlNode

Parse a ByteString buffer (this is faster)

emitYamlBytes :: YamlNode -> IO Buf

data YamlNode

Constructors

MkNode |
Fields n_id :: !SYMID n_elem :: !YamlElem n_tag :: !YamlTag n_anchor :: !YamlAnchor

Instances

Eq YamlNode |
Data YamlNode |
Ord YamlNode |
Show YamlNode |
Typeable YamlNode |

data YamlElem

Constructors

EMap [(YamlNode, YamlNode)] |
ESeq [YamlNode] |
EStr !Buf |
ENil |

Instances

Eq YamlElem |
Data YamlElem |
Ord YamlElem |
Show YamlElem |
Typeable YamlElem |

data YamlAnchor

Constructors

AAnchor !Int |
AReference !Int |
ASingleton |

Instances

Eq YamlAnchor |
Data YamlAnchor |
Ord YamlAnchor |
Show YamlAnchor |
Typeable YamlAnchor |

tagNode :: YamlTag -> YamlNode -> YamlNode

nilNode :: YamlNode

mkNode :: YamlElem -> YamlNode

mkTagNode :: String -> YamlElem -> YamlNode

mkTagStrNode :: String -> String -> YamlNode

type SYMID = CULong

packBuf :: String -> Buf

Convert a regular Haskell string into a ByteString buffer

unpackBuf :: Buf -> String

Convert a ByteString buffer into a regular Haskell string