<div dir="ltr">The yaml package[1] currently provides two modules. Text.Libyaml is a lower level, streaming API which is essentially a raw exposure of the underlying libyaml C library. Data.Yaml uses the aeson Value data type and ToJSON/FromJSON type classes for higher level serialization. For many cases, this approach works well, though there are problems:<div>

<br></div><div>* There are problems with roundtripping, since YAML allows for ambiguity about the data type of values[2]. For example, in the yaml snippet `foo: 1234`, is 1234 intended to be numeric or a string? Either is valid.</div>

<div>* YAML is intended to be human-readable output. But Data.Yaml provides no control over the encoded representation, e.g. should we use single or double quotes for a string (or no quotes at all), or the order of values in a mapping[3].</div>

<div><br></div><div>For other examples, just look at the issue tracker for yaml[4].</div><div><br></div><div>I don't want to drop the current aeson-based functionality, since I think it's still valid and useful in many cases. But I do think it's worthwhile to add in an alternative API which handles YAML-specific constructs better. My idea is:</div>

<div><br></div><div>* Create a new Data.Yaml.Aeson module, and have it mirror Data.Yaml.</div><div>* Deprecate Data.Yaml.</div><div>* Create a new Data.Yaml.? module to contain this YAML-specific API.</div><div><br></div>

<div>I'm asking for feedback on that last point. I have some basic ideas on what such an API would look like, but given that there are many people using YAML in ways different than how I'm using it, I don't think an API designed entirely by me will suit all use cases.</div>

<div><br></div><div>I've opened up a new issue[5] to track this work. If you're interested in participating in this design, please contact me. I'm happy to have the discussion on this mailing list, but if (as I suspect) there are just a handful of people who are interested in pushing this forward, it likely makes sense to take the discussion offlist.</div>

<div><br></div><div>Michael</div><div><div><br></div><div>[1] <a href="http://hackage.haskell.org/package/yaml" target="_blank">http://hackage.haskell.org/package/yaml</a></div></div><div>[2] <a href="https://github.com/snoyberg/yaml/issues/22" target="_blank">https://github.com/snoyberg/yaml/issues/22</a></div>

<div>[3] <a href="https://github.com/snoyberg/yaml/issues/37" target="_blank">https://github.com/snoyberg/yaml/issues/37</a></div><div>[4] <a href="https://github.com/snoyberg/yaml/issues" target="_blank">https://github.com/snoyberg/yaml/issues</a></div>

<div>[5] <a href="https://github.com/snoyberg/yaml/issues/38" target="_blank">https://github.com/snoyberg/yaml/issues/38</a></div></div>