Some pretty printing "improvements" (hopefully)
This commit is contained in:
parent
f7149ba23f
commit
90b1e452e2
@ -55,11 +55,16 @@ fnDoc :: FilePath -> Doc
|
|||||||
fnDoc = doubleQuotes . text
|
fnDoc = doubleQuotes . text
|
||||||
|
|
||||||
showDoc :: Show a => a -> Doc
|
showDoc :: Show a => a -> Doc
|
||||||
showDoc = text . show
|
showDoc = strLnDoc . show
|
||||||
|
|
||||||
warnDoc :: Doc -> Doc
|
warnDoc :: Doc -> Doc
|
||||||
warnDoc d = text "Warning" <+>: d
|
warnDoc d = text "Warning" <+>: d
|
||||||
|
|
||||||
|
strLnDoc :: String -> Doc
|
||||||
|
strLnDoc str = doc (dropWhileEnd isSpace str)
|
||||||
|
where
|
||||||
|
doc = lines >>> map text >>> foldr ($+$) empty
|
||||||
|
|
||||||
strDoc :: String -> Doc
|
strDoc :: String -> Doc
|
||||||
strDoc str = doc (dropWhileEnd isSpace str)
|
strDoc str = doc (dropWhileEnd isSpace str)
|
||||||
where
|
where
|
||||||
|
Loading…
Reference in New Issue
Block a user