From d6d419e743cec6c2f84b693a68c5114e2bc2c698 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 29 Feb 2016 16:58:45 -0500 Subject: [PATCH] Define the Row instance in terms of the Line instance. --- src/Renderer/JSON.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Renderer/JSON.hs b/src/Renderer/JSON.hs index bb46f3e22..0c84f421a 100644 --- a/src/Renderer/JSON.hs +++ b/src/Renderer/JSON.hs @@ -47,9 +47,7 @@ instance Show (JSON a) where newtype JSONWrapper a = JSONWrapper { unWrap :: a } instance JSON a => JSON (JSONWrapper (Row a)) where - showJSON (JSONWrapper (Row left right)) = JSObject $ toJSObject [("left", showLine left), ("right", showLine right)] - where showLine EmptyLine = JSNull - showLine (Line a) = showJSONs (toList a) + showJSON (JSONWrapper (Row left right)) = JSObject $ toJSObject [("left", showJSON (JSONWrapper left)), ("right", showJSON (JSONWrapper right))] instance JSON a => JSON (JSONWrapper (Line a)) where showJSON (JSONWrapper EmptyLine) = JSNull