module Terminal (
- putGreenLn,
- report_error)
+ hPutBlueStr,
+ hPutRedStr,
+ putGreenLn )
where
import Control.Monad.IO.Class (MonadIO(..))
ColorIntensity( Vivid ),
ConsoleLayer( Foreground ),
setSGR )
-import System.IO ( Handle, hPutStrLn, stderr )
+import System.IO ( Handle, hPutStr )
-- | Perform a computation (anything in MonadIO) with the given
-- graphics mode(s) enabled. Revert to the previous graphics mode
-- | Output the given line to the given handle, in red. The silly
-- camelCase name is for consistency with e.g. hPutStrLn.
-hPutRedLn :: Handle -> String -> IO ()
-hPutRedLn h = with_color Red . hPutStrLn h
+hPutRedStr :: Handle -> String -> IO ()
+hPutRedStr h = with_color Red . hPutStr h
--- | Output the given line to stdout. The silly camelCase name is for
--- consistency with e.g. putStrLn.
+-- | Output the given line to the given handle, in blue. The silly
+-- camelCase name is for consistency with e.g. hPutStrLn.
+hPutBlueStr :: Handle -> String -> IO ()
+hPutBlueStr h = with_color Blue . hPutStr h
+
+-- | Output the given line to stdout, in green. The silly camelCase
+-- name is for consistency with e.g. putStrLn.
putGreenLn :: String -> IO ()
putGreenLn = with_color Green . putStrLn
-
--- | Report an error (to stderr).
-report_error :: String -> IO ()
-report_error = hPutRedLn stderr