From 48175bb9b099be9dfdaea5e7b3bfdc60a03f54b2 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sat, 9 Sep 2017 12:35:20 +0100 Subject: [PATCH] Define a Show instance for Diff. --- src/Diff.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Diff.hs b/src/Diff.hs index 789670332..7dd84113a 100644 --- a/src/Diff.hs +++ b/src/Diff.hs @@ -118,6 +118,9 @@ instance (Eq1 f, Eq a, Eq b) => Eq (DiffF f a b) where instance Show1 f => Show1 (Diff f) where liftShowsPrec sp sl = go where go d = showsUnaryWith (liftShowsPrec2 sp sl go (showListWith (go 0))) "Diff" d . unDiff +instance (Show1 f, Show a) => Show (Diff f a) where + showsPrec = showsPrec1 + instance Show1 f => Show2 (DiffF f) where liftShowsPrec2 spA slA spB slB d diff = case diff of Copy ann r -> showsBinaryWith (liftShowsPrecBoth spA slA) (liftShowsPrec spB slB) "Copy" d ann r