summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-04-28 23:02:24 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-04-28 23:02:24 +0200
commit58a479b781935155e09f565d2488693850bf21c6 (patch)
tree8d568877c550bebe88bb34d9f9cce612d2822964
parent67fd4cabceda047750c19e9bef98e0c25c6ed7dd (diff)
add missing instance
-rw-r--r--src/LambdaCube/Compiler/Pretty.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/LambdaCube/Compiler/Pretty.hs b/src/LambdaCube/Compiler/Pretty.hs
index fc514225..a8fdf851 100644
--- a/src/LambdaCube/Compiler/Pretty.hs
+++ b/src/LambdaCube/Compiler/Pretty.hs
@@ -193,6 +193,8 @@ a </> b = DDoc $ DOSoftSep a b
193a <$$> b = DDoc $ DOVCat a b 193a <$$> b = DDoc $ DOVCat a b
194nest n = DDoc . DONest n 194nest n = DDoc . DONest n
195tupled = DDoc . DOTupled 195tupled = DDoc . DOTupled
196bracketed [] = text "[]"
197bracketed xs = DPar "[" (foldr1 DComma xs) "]"
196 198
197hsep [] = mempty 199hsep [] = mempty
198hsep xs = foldr1 (<+>) xs 200hsep xs = foldr1 (<+>) xs
@@ -279,7 +281,7 @@ instance (PShow a, PShow b, PShow c) => PShow (a, b, c) where
279 pShow (a, b, c) = tupled [pShow a, pShow b, pShow c] 281 pShow (a, b, c) = tupled [pShow a, pShow b, pShow c]
280 282
281instance PShow a => PShow [a] where 283instance PShow a => PShow [a] where
282-- pShow = P.brackets . P.sep . P.punctuate P.comma . map pShow -- TODO 284 pShow = bracketed . map pShow
283 285
284instance PShow a => PShow (Maybe a) where 286instance PShow a => PShow (Maybe a) where
285 pShow = maybe "Nothing" (("Just" `DApp`) . pShow) 287 pShow = maybe "Nothing" (("Just" `DApp`) . pShow)