Skip to content

Commit ce8a263

Browse files
Update README.md
1 parent eb42023 commit ce8a263

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ someObject =
3333
fromObject $ Object.fromFoldable [ Tuple "foo" (fromArray objects) ]
3434
```
3535

36-
The `decodeJson`, `.:`, `.:?`, and `.!=` functions provided in this module make it straightforward to interrogate the `Json` object:
36+
The `decodeJson`, `.:`, `.:?`, and `.!=` functions provided in this module make it straightforward to decode this JSON to a custom data type and serialize that custom data type back to JSON:
3737

3838
```purescript
3939
newtype MyType = MyType
@@ -61,10 +61,10 @@ decodeMyTypes json = do
6161
-- create a `EncodeJson` instance
6262
instance encodeJsonMyType :: EncodeJson MyType where
6363
encodeJson (MyType x) =
64-
"foo" := x.foo ~>
65-
"bar" :=? x.bar ~>? -- optional field
66-
"baz" := x.baz ~>
67-
jsonEmptyObject
64+
"foo" := x.foo
65+
~> "bar" :=? x.bar
66+
~>? "baz" := x.baz -- optional field
67+
~> jsonEmptyObject
6868
```
6969

7070
## Contributing

0 commit comments

Comments
 (0)