diff options
| author | Max Bolingbroke <batterseapower@hotmail.com> | 2010-04-13 19:28:25 +0000 |
|---|---|---|
| committer | Max Bolingbroke <batterseapower@hotmail.com> | 2010-04-13 19:28:25 +0000 |
| commit | 00022894bbb2dfa33fd213eedbac0f28b4c4b7b4 (patch) | |
| tree | 849a53c55d4a0071059bd100b205bf5b558089b0 /compiler/utils/Outputable.lhs | |
| parent | 5e5018b65d98a090f069f3b861f30ffe3c196fd5 (diff) | |
| download | haskell-00022894bbb2dfa33fd213eedbac0f28b4c4b7b4.tar.gz | |
Spelling correction for LANGUAGE pragmas
Diffstat (limited to 'compiler/utils/Outputable.lhs')
| -rw-r--r-- | compiler/utils/Outputable.lhs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index 84e8b9d1d4..b948990953 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -17,7 +17,7 @@ module Outputable ( -- * Pretty printing combinators SDoc, docToSDoc, - interppSP, interpp'SP, pprQuotedList, pprWithCommas, + interppSP, interpp'SP, pprQuotedList, pprWithCommas, quotedListWithOr, empty, nest, char, text, ftext, ptext, @@ -660,7 +660,15 @@ interpp'SP xs = sep (punctuate comma (map ppr xs)) -- -- > [x,y,z] ==> `x', `y', `z' pprQuotedList :: Outputable a => [a] -> SDoc -pprQuotedList xs = hsep (punctuate comma (map (quotes . ppr) xs)) +pprQuotedList = quotedList . map ppr + +quotedList :: [SDoc] -> SDoc +quotedList xs = hsep (punctuate comma (map quotes xs)) + +quotedListWithOr :: [SDoc] -> SDoc +-- [x,y,z] ==> `x', `y' or `z' +quotedListWithOr xs@(_:_:_) = quotedList (init xs) <+> ptext (sLit "or") <+> quotes (last xs) +quotedListWithOr xs = quotedList xs \end{code} |
