aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2022-01-01 16:24:03 +0000
committerLouis Pilfold <louis@lpil.uk>2022-01-01 16:24:03 +0000
commite1262aef6754a2b4aefc3aeb99ce0f9857d689a4 (patch)
tree3a4513280168fedcfd2698d89940a4fcbb41ae69
parenta0d4e6eb54de54bbb33df486374701bbdcd6c3e9 (diff)
downloadgleam_json-e1262aef6754a2b4aefc3aeb99ce0f9857d689a4.tar.gz
gleam_json-e1262aef6754a2b4aefc3aeb99ce0f9857d689a4.zip
I wish we had syntax highlighting
-rw-r--r--README.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/README.md b/README.md
index 415a654..0fc8f04 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,10 @@ Work with JSON in Gleam!
### Encoding
```rust
+import myapp.{Cat}
import gleam/list
import gleam/json.{object, string, list, int, null}
-pub type Cat {
- Cat(name: String)
-}
-
pub fn cat_to_json(cat: Cat) -> String {
object([
#("name", string(cat.name)),
@@ -29,6 +26,7 @@ JSON is decoded into a `Dynamic` value which can be decoded using the
`gleam/dynamic` module from the Gleam standard library.
```rust
+import myapp.{Cat}
import gleam/json
import gleam/dynamic.{DecodeError}
import gleam/result