Improved the Rain support in ShowCode a little

This commit is contained in:
Neil Brown 2008-06-01 17:58:40 +00:00
parent 4b6fa48cd3
commit 969c04d42b

View File

@ -583,6 +583,9 @@ instance ShowOccam A.ExpressionList where
showOccamM (A.ExpressionList _ es) = showWithCommas es
--TODO functioncalllist
instance ShowRain A.ExpressionList where
showRainM (A.ExpressionList _ [e]) = showRainM e
outerOccam :: (Data a, ShowOccam a) => String -> A.Structured a -> CodeWriter ()
outerOccam keyword (A.Rep _ rep str)
= do showOccamLine (tell [keyword] >> showOccamM rep)
@ -684,8 +687,8 @@ instance ShowRain A.Replicator where
--TEMP:
instance ShowRain a where
showRainM = const $ tell ["$"]
instance Data a => ShowRain a where
showRainM = tell . singleton . gshow
instance ShowOccam a => ShowOccam [a] where
showOccamM xs = tell ["["] >> sequence (intersperse (tell [", "]) $ map