From 2111e20f33a004f560e2190743264a582c9d9bbf Mon Sep 17 00:00:00 2001
From: Nathan McCarty <thatonelutenist@stranger.systems>
Date: Sat, 25 Jan 2025 05:09:24 -0500
Subject: [PATCH] json: Bool and null

---
 src/Parser/JSON.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/Parser/JSON.md b/src/Parser/JSON.md
index c4d987d..7e83fd7 100644
--- a/src/Parser/JSON.md
+++ b/src/Parser/JSON.md
@@ -215,3 +215,25 @@ number = do
   d <- double
   pure $ VNumber d
 ```
+
+```idris
+bool = do
+  oneOfE
+    (throwParseError "Expected Bool")
+    (the (List _) [true, false])
+  where
+    true : Parser (JSONValue TBool)
+    true = do
+      _ <- exactString "true" 
+      pure $ VBool True
+    false : Parser (JSONValue TBool)
+    false = do
+      _ <- exactString "false" 
+      pure $ VBool False
+```
+
+```idris
+null = do
+  _ <- exactString "null"
+  pure VNull
+```