autodocodec-yaml 0.2.0.2 → 0.2.0.3
raw patch · 3 files changed
+11/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +7/−0
- autodocodec-yaml.cabal +2/−2
- src/Autodocodec/Yaml.hs +2/−1
CHANGELOG.md view
@@ -1,5 +1,12 @@ # Changelog +## [0.2.0.3] - 2023-01-01++### Changed++Use the `ToYaml` instance instead of the `ToJSON` instance when encoding to Yaml.+This preserves the key order where `ToJSON` wouldn't.+ ## [0.2.0.2] - 2022-07-21 ### Added
autodocodec-yaml.cabal view
@@ -5,13 +5,13 @@ -- see: https://github.com/sol/hpack name: autodocodec-yaml-version: 0.2.0.2+version: 0.2.0.3 synopsis: Autodocodec interpreters for yaml homepage: https://github.com/NorfairKing/autodocodec#readme bug-reports: https://github.com/NorfairKing/autodocodec/issues author: Tom Sydney Kerckhove maintainer: syd@cs-syd.eu-copyright: 2021 Tom Sydney Kerckhove+copyright: 2021-2023 Tom Sydney Kerckhove license: MIT license-file: LICENSE build-type: Simple
src/Autodocodec/Yaml.hs view
@@ -35,10 +35,11 @@ import Autodocodec.Yaml.Schema import Data.ByteString import qualified Data.Yaml as Yaml+import qualified Data.Yaml.Builder as Yaml -- | Encode a value as a Yaml 'ByteString' via its type's 'codec'. encodeYamlViaCodec :: HasCodec a => a -> ByteString-encodeYamlViaCodec = Yaml.encode . Autodocodec+encodeYamlViaCodec = Yaml.toByteString . Autodocodec -- | Parse a Yaml 'ByteString' using a type's 'codec'. eitherDecodeYamlViaCodec :: HasCodec a => ByteString -> Either Yaml.ParseException a