From a5ea018b84db1ea74b7d85f65ee40402e5019485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20W=C3=BCnsche=20=28ehem=20Heyn=29?= Date: Fri, 16 Feb 2024 20:36:44 +0100 Subject: [PATCH] Update README.md Added an import for a working example. Changed `Maybe` to `Either` for a working example. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f8fcf2..912c369 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ In general, if a JavaScript value could be returned from a call to `JSON.parse` You can also use the construction functions which follow the naming convention `fromX` or `jsonX`: ```purs +import Data.Argonaut.Core import Data.Tuple (Tuple(..)) import Foreign.Object as Object import Data.Argonaut.Core as A @@ -67,8 +68,9 @@ 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 an `Either` value, where a parsing error is represented with `Left` containing an error message. ```purs +import Data.Argonaut.Core import Data.Argonaut.Parser (jsonParser) -import Data.Maybe (Maybe(..)) +import Data.Either (Either) someObject :: Either String Json someObject = jsonParser