You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+170-3Lines changed: 170 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,175 @@ New features:
10
10
11
11
Bugfixes:
12
12
13
-
* Changed type in docs of `decodeJson` from `forall a. DecodeJson a => Json -> Either String a` to `forall a. DecodeJson a => Json -> Either JsonDecodeError a`.
This release introduces a shift in the way this library handles errors. Previously, errors were reported as `String` values when decoding. Now, errors are reported as `JsonDecodeError` values, which provide much richer information about what errors have occurred. This brings this library into line with `purescript-codec-argonaut`, which also uses typed errors.
22
+
23
+
There are new functions to help work with this error type:
24
+
25
+
-`printJsonDecodeError :: JsonDecodeError -> String` can be used to recover a string error from a typed error
26
+
-`parseJson :: String -> Either JsonDecodeError Json` can be used instead of `Data.Argonaut.Parser.jsonParser` if you need to parse a `Json` value from a JSON string. It uses `jsonParser` under the hood, but provides a typed error instead of a string error.
27
+
28
+
Implemented in #73 and relevant documentation updated in #80.
29
+
30
+
**Add encoding and decoding functions without type classes**
31
+
32
+
Sometimes it is useful to be able to use the encoders and decoders defined in this library without needing the type classes. If you want to use the functions directly without a type class, they can now be found in the `Data.Argonaut.Decode.Decoders` and `Data.Argonaut.Encode.Encoders` modules.
33
+
34
+
Implemented in #74.
35
+
36
+
**Removed deprecated functions and operators**
37
+
38
+
A number of functions and operators were deprecated in the last release. Their removal doesn't change the functionality of this library -- as noted in the prior release, all deprecated operators have functionally-equivalent alternatives. For example:
39
+
40
+
-`.?` -> `.:`
41
+
-`.??` -> `.:?`
42
+
-`.?!` -> `.:!`
43
+
44
+
Implemented in #82.
45
+
46
+
**Migrate the library to use Spago**
47
+
48
+
This is a purely internal change, but the `purescript-argonaut-codecs` library now uses Spago internally to manage dependencies and the overall build. Over time the purescript-contrib organization will shift to use Spago instead of Pulp + Bower.
- Encoding and decoding of `Maybe` has been updated to be able to accurately represent nested `Maybe`s. The `DecodeJson` instance is compatible with the old format, but `EncodeJson` produces a different structure now, so this may be a breaking change depending on your use case.
0 commit comments