X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhtsn.git;a=blobdiff_plain;f=src%2FTerminal.hs;h=cd35bf0e08bc1c2e85083f8568054845471a5110;hp=e9b59dc4df473029f42b4bcdcc57bc85b4f49f9f;hb=95e23e65db31cf51c9f207a6b447da19920ee1a1;hpb=3fbc7d861d1f95513151010cd0f2d620befc2870 diff --git a/src/Terminal.hs b/src/Terminal.hs index e9b59dc..cd35bf0 100644 --- a/src/Terminal.hs +++ b/src/Terminal.hs @@ -1,6 +1,6 @@ module Terminal ( - hPutRedLn, - putGreenLn) + putGreenLn, + report_error) where import Control.Monad.IO.Class (MonadIO(..)) @@ -10,7 +10,7 @@ import System.Console.ANSI ( ColorIntensity( Vivid ), ConsoleLayer( Foreground ), setSGR ) -import System.IO ( Handle, hPutStrLn ) +import System.IO ( Handle, hPutStrLn, stderr ) -- | Perform a computation (anything in MonadIO) with the given -- graphics mode(s) enabled. Revert to the previous graphics mode @@ -39,3 +39,7 @@ hPutRedLn h = with_color Red . hPutStrLn h -- 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