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 +```