Open
Description
Here is a suggestion for an Aeson 1.5-2.0 compatibilty story. The technique is simple: take Aeson 2.0 and change the version 2 abstract types to type synonyms as below (plus chasing up the ensuing, minor, type errors).
This backports the 2.0 API to 1.5, and ought to allow Aeson users to write code that works at the same time against version 1.5 and version 2.0, providing a smooth upgrade path and avoiding the need for a "big bang" switch of the entire Aeson ecosystem at once.
-newtype Key = Key { unKey :: Text }
+type Key = Text
-newtype KeyMap v = KeyMap { unKeyMap :: Map Key v }
+type KeyMap v = Map Key v
I don't actually use Aeson myself, so I would welcome the input of Aeson users and maintainers (esp. @bergmark) regarding
- whether this is actually useful, and if so
- whether I've got everything correct (the tests pass)
Metadata
Metadata
Assignees
Labels
No labels