@@ -70,10 +70,12 @@ data IResult i r =
7070 -- not yet been consumed (if any) when the parse succeeded.
7171
7272instance (Show i, Show r) => Show (IResult i r) where
73− show (Fail t stk msg) =
74− unwords [ "Fail", show t, show stk, show msg]
75− show (Partial _) = "Partial _"
76− show (Done t r) = unwords ["Done", show t, show r]
73+ showsPrec d ir = showParen (d > 10) $
74+ case ir of
75+ (Fail t stk msg) -> showString "Fail" . f t . f stk . f msg
76+ (Partial _) -> showString "Partial _"
77+ (Done t r) -> showString "Done" . f t . f r
78+ where f x = showChar ' ' . showsPrec 11 x
7779
7880instance (NFData i, NFData r) => NFData (IResult i r) where
7981 rnf (Fail t stk msg) = rnf t `seq` rnf stk `seq` rnf msg