mirror of
https://github.com/Mesabloo/diagnose.git
synced 2024-11-25 14:32:38 +03:00
Diagnostic: allow printing without colors
This commit is contained in:
parent
a4d52a8b1c
commit
fbb1577c6d
@ -37,5 +37,5 @@ instance (Foldable s, PrettyText (s a), PrettyText m) => PrettyText (Diagnostic
|
|||||||
|
|
||||||
|
|
||||||
-- | Prints a @'Diagnostic' s m a@ To the given @'Handle'@
|
-- | Prints a @'Diagnostic' s m a@ To the given @'Handle'@
|
||||||
printDiagnostic :: (Foldable s, PrettyText (s a), PrettyText m) => Handle -> Diagnostic s m a -> IO ()
|
printDiagnostic :: (Foldable s, PrettyText (s a), PrettyText m) => Bool -> Handle -> Diagnostic s m a -> IO ()
|
||||||
printDiagnostic handle diag = displayIO handle (renderPretty 0.9 80 $ prettyText diag)
|
printDiagnostic withColor handle diag = displayIO handle (renderPretty 0.9 80 . (if withColor then id else plain) $ prettyText diag)
|
||||||
|
Loading…
Reference in New Issue
Block a user