From 13df366dcd91f9c411c885851f630972abe79f5b Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 23 Aug 2017 12:07:39 -0400 Subject: [PATCH] =?UTF-8?q?Define=20Patch=E2=80=99s=20Pretty1=20instance?= =?UTF-8?q?=20generically.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Patch.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Patch.hs b/src/Patch.hs index 87bab6aca..d67ced4a7 100644 --- a/src/Patch.hs +++ b/src/Patch.hs @@ -89,10 +89,7 @@ instance Crosswalk Patch where crosswalk f (Insert b) = Insert <$> f b crosswalk f (Delete a) = Delete <$> f a -instance Pretty1 Patch where - liftPretty p _ (Replace a b) = nest 2 (vsep [ pretty ("Replace" :: String), p a, p b ]) - liftPretty p _ (Insert b) = nest 2 (vsep [ pretty ("Insert" :: String), p b ]) - liftPretty p _ (Delete a) = nest 2 (vsep [ pretty ("Delete" :: String), p a ]) +instance Pretty1 Patch where liftPretty = genericLiftPretty instance Pretty a => Pretty (Patch a) where pretty = liftPretty pretty prettyList