From 65d2fb968c761072586b168b4117d3aaa9762f54 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 15 May 2018 17:51:56 -0400 Subject: [PATCH] Customize the Show instance for Pos for brevity. --- src/Data/Span.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Data/Span.hs b/src/Data/Span.hs index dd10e1e45..f9ebd2a39 100644 --- a/src/Data/Span.hs +++ b/src/Data/Span.hs @@ -22,7 +22,7 @@ data Pos = Pos { posLine :: !Int , posColumn :: !Int } - deriving (Show, Eq, Ord) + deriving (Eq, Ord) instance A.ToJSON Pos where toJSON Pos{..} = @@ -33,6 +33,10 @@ instance A.FromJSON Pos where [line, col] <- A.parseJSON arr pure $ Pos line col +instance Show Pos where + showsPrec d Pos{..} = showsBinaryWith showsPrec showsPrec "Pos" d posLine posColumn + + data Span = Span { spanStart :: Pos , spanEnd :: Pos