Skip to content

Commit

Permalink
Oops, print to right device.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed May 23, 2023
1 parent 889eeb9 commit c304a93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Futhark/Util/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import Prettyprinter.Render.Terminal (AnsiStyle, Color (..), bgColor, bgColorDul
import Prettyprinter.Render.Terminal qualified
import Prettyprinter.Render.Text qualified
import Prettyprinter.Symbols.Ascii
import System.IO (Handle, hIsTerminalDevice, stdout)
import System.IO (Handle, hIsTerminalDevice, hPutStrLn, stdout)

-- | Print a doc with styling to the given file; stripping colors if
-- the file does not seem to support such things.
Expand All @@ -67,16 +67,16 @@ hPutDoc h d = do
hPutDocLn :: Handle -> Doc AnsiStyle -> IO ()
hPutDocLn h d = do
hPutDoc h d
putStrLn ""
hPutStrLn h ""

-- | Like 'hPutDoc', but to stdout.
putDoc :: Doc AnsiStyle -> IO ()
putDoc = hPutDoc stdout

-- | Like 'putDoc', but with a final newline.
putDocLn :: Doc AnsiStyle -> IO ()
putDocLn h = do
putDoc h
putDocLn d = do
putDoc d
putStrLn ""

-- | Produce text suitable for printing on the given handle. This
Expand Down

0 comments on commit c304a93

Please sign in to comment.