From ec8ae0156f5e524945e74bc0db5b5cb70ef33cf4 Mon Sep 17 00:00:00 2001 From: dk949 <56653556+dk949@users.noreply.github.com> Date: Sat, 20 Nov 2021 21:53:20 +0000 Subject: [PATCH 1/2] Made the README example runable added `module Main where` removed import of `jsonParser` from `Data.Argonaut.Core` renamed `json` to `sampleJson` --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7b24bfb..eb99958 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,16 @@ You can use the prisms defined in `Data.Argonaut.Prisms` with functions from the ```js // FFI file -exports.sampleJson = { "a": { "b" [ 10, 11, 12 ] } } +exports.sampleJson = { "a": { "b": [ 10, 11, 12 ] } } ``` ```purs +module Main where + import Prelude import Effect (Effect) -import Data.Argonaut.Core (Json, jsonParser) +import Data.Argonaut.Core (Json) import Data.Argonaut.Prisms (_Array, _Number, _Object) import Data.Maybe (Maybe(..)) import Data.Lens (preview) @@ -48,7 +50,7 @@ main :: Effect Unit main = -- Walk through an object at the key 'a', then an object at the key 'b', then -- get the first index of an array as a number. - case preview (_Object <<< ix "a" <<< _Object <<< ix "b" <<< _Array <<< ix 0 <<< _Number) json of + case preview (_Object <<< ix "a" <<< _Object <<< ix "b" <<< _Array <<< ix 0 <<< _Number) sampleJson of Nothing -> log "nothin' there" Just v -> log $ "This should be 10.0 " <> show v ``` From 52f102727c2b00cad439aa6c909e19c338887ae1 Mon Sep 17 00:00:00 2001 From: dk949 <56653556+dk949@users.noreply.github.com> Date: Sat, 20 Nov 2021 22:04:48 +0000 Subject: [PATCH 2/2] updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8561c8..7002e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ New features: Bugfixes: Other improvements: +- Updated `README.md` to make the Quick start example runnable (#37 by @dk949) - Added `purs-tidy` formatter (#36 by @thomashoneyman) ## [v9.0.0](https://github.com/purescript-contrib/purescript-argonaut-traversals/releases/tag/v9.0.0) - 2021-02-26