From cd4949b2f8cefcfed4eee0579b357bb5bbeae93f Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Mon, 27 Jan 2025 20:15:04 -0500 Subject: [PATCH] Export JSON show and Eq --- src/Parser/JSON.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Parser/JSON.md b/src/Parser/JSON.md index b69db49..60386ef 100644 --- a/src/Parser/JSON.md +++ b/src/Parser/JSON.md @@ -55,6 +55,7 @@ data JSONValue : JSONType -> Type where ``` ```idris hide +export Show (JSONValue t) where show (VObject xs) = let xs = dMap (\_,(key, value) => "\"\{key}\":\{show value}") xs @@ -69,6 +70,7 @@ Show (JSONValue t) where show VNull = "null" -- TODO: Deal with keys potentially having different orders in different objects +export Eq (JSONValue t) where (VObject xs) == (VObject ys) = assert_total $ xs $== ys