packages feed

autodocodec-yaml 0.2.0.0 → 0.2.0.2

raw patch · 4 files changed

+13/−3 lines, 4 filesdep ~autodocodecPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: autodocodec

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.2.0.2] - 2022-07-21++### Added++* Support for the `discriminatedUnionCodec` for discriminated unions in `autodocodec-0.2.0.0`+ ## [0.2.0.1] - 2022-04-28  ### Changed
LICENSE view
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Tom Sydney Kerckhove+Copyright (c) 2021-2022 Tom Sydney Kerckhove  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
autodocodec-yaml.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           autodocodec-yaml-version:        0.2.0.0+version:        0.2.0.2 synopsis:       Autodocodec interpreters for yaml homepage:       https://github.com/NorfairKing/autodocodec#readme bug-reports:    https://github.com/NorfairKing/autodocodec/issues@@ -34,7 +34,7 @@   hs-source-dirs:       src   build-depends:-      autodocodec+      autodocodec >=0.2.0.0     , autodocodec-schema >=0.1.0.0     , base >=4.7 && <5     , bytestring
src/Autodocodec/Yaml/Encode.hs view
@@ -64,6 +64,10 @@       EitherCodec _ c1 c2 -> case (a :: Either _ _) of         Left a1 -> goObject a1 c1         Right a2 -> goObject a2 c2+      DiscriminatedUnionCodec propertyName m _ ->+        case m a of+          (discriminatorValue, c) ->+            (propertyName, Yaml.string discriminatorValue) : goObject a c       PureCodec _ -> []       ApCodec oc1 oc2 -> goObject a oc1 <> goObject a oc2