HsYAML v0.2.1.0 Release Notes

Release Date: 2019-10-06 // about 2 years ago
    • Define Functor Doc instance (#33)
    • 🆕 New withScalar function and also define ToYAML Scalar and FromYAML Scalar instances
    • Export Pair type synonym from Data.YAML (#31)
    • 🆕 New Data.YAML.prettyPosWithSource function for pretty-printing source locations (i.e. Pos values)
    • ➕ Add export docRoot :: Doc n -> n field accessor for convenience (#32)

Previous changes from v0.2.0.0

  • 🚀 This release incorporates the work from Vijay Tadikamalla's GSOC 2019 Project. 🚀 Highlights of this major release include support for emitting YAML as well as providing direct access to source locations throughout the 📜 parsing pipeline for improved error reporting.

    • 🔄 Changes in Data.YAML module

      • YAML 1.2 Schema encoders (#21)
      • New ToYAML class for encoding Haskell Data-types from which YAML nodes can be constructed (#20)
        • New functions like encodeNode, encodeNode' for constructing AST
        • New functions like encode, encode1, encodeStrict, encode1Strict for supporting typeclass-based dumping
        • Some ToYAML instances and other api
      • Modify typeMismatch function to show error source location in error messages (#19)
      • Provide location-aware failAtNode alternative to fail
    • 🔄 Changes in Data.YAML.Event module

      • Preserve and round-trip Comments at Event level(#24)
        • New Comment Event to preserve comments while parsing
        • Some additional implementations to preserve and round-trip comments
      • Fix issue #22
      • New EvPos type for recording event and their corresponding position (#19)
      • Preserve Flow Mapping and Flow sequence (#18)
      • Features to preserve Literal/Folded ScalarStyle (#15)
        • New Chomp type denoting Block Chomping Indicator
        • New IndentOfs type denoting Block Indentation Indicator
      • New NodeStyle type denoting flow/block style
      • Event(SequenceStart,MappingStart) constructors now record NodeStyle
      • Style type renamed to ScalarType
      • New writeEvents and writeEventsText function
      • Event(DocumentStart) now records YAML directive
      • Event parser now rejects duplicate/unsupported YAML/TAG directives as mandated by the YAML 1.2 specification
    • 🚚 Move some schema related definitions from Data.YAML into the new Data.YAML.Schema module

    • 👉 Make decode, decode1, decodeStrict, decode1Strict, decodeNode, and decodeNode' treat duplicate keys (under the respective YAML schema) in YAML mappings as a loader-error (controllable via new schemaResolverMappingDuplicates schema property)

    • Define Generic and NFData instances for most types

    • 🛠 Fix X38W testcase (#13, #14)