diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-04-28 23:02:24 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-04-28 23:02:24 +0200 |
commit | 58a479b781935155e09f565d2488693850bf21c6 (patch) | |
tree | 8d568877c550bebe88bb34d9f9cce612d2822964 /src | |
parent | 67fd4cabceda047750c19e9bef98e0c25c6ed7dd (diff) |
add missing instance
Diffstat (limited to 'src')
-rw-r--r-- | src/LambdaCube/Compiler/Pretty.hs | 4 |
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 | |||
193 | a <$$> b = DDoc $ DOVCat a b | 193 | a <$$> b = DDoc $ DOVCat a b |
194 | nest n = DDoc . DONest n | 194 | nest n = DDoc . DONest n |
195 | tupled = DDoc . DOTupled | 195 | tupled = DDoc . DOTupled |
196 | bracketed [] = text "[]" | ||
197 | bracketed xs = DPar "[" (foldr1 DComma xs) "]" | ||
196 | 198 | ||
197 | hsep [] = mempty | 199 | hsep [] = mempty |
198 | hsep xs = foldr1 (<+>) xs | 200 | hsep 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 | ||
281 | instance PShow a => PShow [a] where | 283 | instance 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 | ||
284 | instance PShow a => PShow (Maybe a) where | 286 | instance PShow a => PShow (Maybe a) where |
285 | pShow = maybe "Nothing" (("Just" `DApp`) . pShow) | 287 | pShow = maybe "Nothing" (("Just" `DApp`) . pShow) |