encode package:HsYAML

Serialize YAML Node(s) using the YAML 1.2 Core schema to a lazy UTF8 encoded ByteString. Each YAML Node produces exactly one YAML Document. Here is an example of encoding a list of strings to produce a list of YAML Documents
>>> encode (["Document 1", "Document 2"] :: [Text])
"Document 1\n...\nDocument 2\n"
If we treat the above list of strings as a single sequence then we will produce a single YAML Document having a single sequence.
>>> encode ([["Document 1", "Document 2"]] :: [[Text]])
"- Document 1\n- Document 2\n"
Alternatively, if you only need a single YAML document in a YAML stream you might want to use the convenience function encode1; or, if you need more control over the encoding, see encodeNode'.
Convenience wrapper over encode taking exactly one YAML Node. Hence it will always output exactly one YAML Document Here is example of encoding a list of strings to produce exactly one of YAML Documents
>>> encode1 (["Document 1", "Document 2"] :: [Text])
"- Document 1\n- Document 2\n"
Like encode1 but outputs a strict ByteString
Dump YAML Nodes as a lazy UTF8 encoded ByteString Each YAML Node is emitted as a individual YAML Document where each Document is terminated by a DocumentEnd indicator. This is a convenience wrapper over encodeNode'
Customizable variant of encodeNode NOTE: A leading BOM will be emitted for all encodings other than UTF8.
Like encode but outputs ByteString
Encode Boolean
Encode Double
Encode Integer
Core schema encoder as specified in YAML 1.2 / 10.3.2. Tag Resolution
"Failsafe" schema encoder as specified in YAML 1.2 / 10.1.2. Tag Resolution
Strict JSON schema encoder as specified in YAML 1.2 / 10.2.2. Tag Resolution