From a6452f93df3f8d76f50b40a21edceb50e088c36d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 20 Mar 2008 16:34:11 +0000 Subject: [PATCH] Added a ShowOccam and ShowRain instance for lists of things --- common/ShowCode.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/ShowCode.hs b/common/ShowCode.hs index 8a54760..0a443f7 100644 --- a/common/ShowCode.hs +++ b/common/ShowCode.hs @@ -544,6 +544,14 @@ instance ShowOccam A.Process where instance ShowRain a where showRainM = const $ return () +instance ShowOccam a => ShowOccam [a] where + showOccamM xs = tell ["["] >> sequence (intersperse (tell [", "]) $ map + showOccamM xs) >> tell ["]"] +instance ShowRain a => ShowRain [a] where + showRainM xs = tell ["["] >> sequence (intersperse (tell [", "]) $ map + showRainM xs) >> tell ["]"] + + -- | Extends an existing (probably generic) function with cases for everything that has a specific ShowOccam and ShowRain instance -- This is a bit of manual wiring. Because we can't generically deduce whether or not -- a given Data item has a showRain\/showOccam implementation (that I know of), I have