Skip to content

Commit 3aaf147

Browse files
authored
Change String to JsonDecodeError to fix docs typo (#88)
* fix: change String to JsonDecodeError in docs * Add changes to the changelog * Moved changes to "Unreleased" section in changelog
1 parent 4e4a240 commit 3aaf147

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ New features:
1010

1111
Bugfixes:
1212

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`.
14+
1315
Other improvements:
1416

1517
## [0.0.0] - 2020-01-01

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ We can automatically decode `Json` using the `DecodeJson` type class ([pursuit](
7575
Every type within `User` has an instance for `DecodeJson`, which means we can use the `decodeJson` function to try to decode a `Json` value into our type. Once again, integer and string values will be decoded directly from the `Json`, but containing types like `Record` and `Maybe` will also require instances for the types they contain.
7676

7777
```purs
78-
decodeJson :: DecodeJson a => Json -> Either String a
78+
decodeJson :: DecodeJson a => Json -> Either JsonDecodeError a
7979
```
8080

8181
> Tip: To parse a JSON string as a `Json` value, you can use the `parseJson` function (which can fail). If you are sure you have valid JSON, then consider writing it in an FFI file and foreign importing it as `Json` as described in the [`argonaut-core` documentation](https://github.com/purescript-contrib/purescript-argonaut-core#introducing-json-values).

0 commit comments

Comments
 (0)