]> gitweb.michael.orlitzky.com - dead/htsn.git/blobdiff - src/Terminal.hs
Add more code documentation.
[dead/htsn.git] / src / Terminal.hs
index 6031d62c5e9a7cdd3919099622c701cb6e9ad60f..064c5ff87e27af60f328f14e9c4d3f05f19cf10d 100644 (file)
@@ -33,24 +33,47 @@ with_color h color =
   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