with_sgr h [SetColor Foreground Vivid color]
+-- | Write the given String to a handle in color. The funnyCaps are
+-- for synergy with putstrLn and friends.
+--
hPutStrColor :: Handle -> Color -> String -> IO ()
hPutStrColor h c = with_color h c . hPutStr h
+
+-- | Write the given line to a handle in color. The funnyCaps are for
+-- synergy with putstrLn and friends.
+--
hPutStrColorLn :: Handle -> Color -> String -> IO ()
hPutStrColorLn h c s = hPutStrColor h c (s ++ "\n")
--- | Don't automatically append a newline.
+
+-- | Display text sent to the feed on the console. Don't automatically
+-- append a newline.
+--
display_sent :: String -> IO ()
display_sent = hPutStrColor stdout Green
+
+-- | Display debug text on the console. Don't automatically append a
+-- newline in case the raw text is needed for, uh, debugging.
+--
display_debug :: String -> IO ()
display_debug = putStr
+
+-- | Display an informational message on the console.
+--
display_info :: String -> IO ()
display_info = hPutStrColorLn stdout Cyan
+
+-- | Display a warning on the console. Uses stderr instead of stdout.
+--
display_warning :: String -> IO ()
display_warning = hPutStrColorLn stderr Yellow
+
+-- | Display an error on the console. Uses stderr instead of stdout.
+--
display_error :: String -> IO ()
display_error = hPutStrColorLn stderr Red