Skip to content

Commit

Permalink
Fix type signature of jsonParser in quick start
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashoneyman authored Mar 7, 2021
1 parent da5148e commit f315154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ someObject =
)
```

Finally, you can parse JSON from a string using the `jsonParser` function. However, this isn't guaranteed to produce a correct value, so it returns a `Maybe` value.
Finally, you can parse JSON from a string using the `jsonParser` function. However, this isn't guaranteed to produce a correct value, so it returns an `Either` value, where a parsing error is represented with `Left` containing an error message.

```purs
import Data.Argonaut.Core (jsonParser)
import Data.Maybe (Maybe(..))
someObject :: Maybe Json
someObject :: Either String Json
someObject = jsonParser
"""
{ people: [{ name: "John" }, { name: "Jane" }] };
Expand Down

0 comments on commit f315154

Please sign in to comment.