diohsc-0.1.14: PrintFancy.hs
-- This file is part of Diohsc
-- Copyright (C) 2020-23 Martin Bays <mbays@sdf.org>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of version 3 of the GNU General Public License as
-- published by the Free Software Foundation, or any later version.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see http://www.gnu.org/licenses/.
module PrintFancy where
import Control.Monad.IO.Class (MonadIO, liftIO)
import System.IO
import ANSIColour
printErrFancy :: MonadIO m => Bool -> String -> m ()
printErrFancy ansi s = liftIO . hPutStrLn stderr . applyIf ansi (withColourStr BoldRed) $ "! " <> s
printInfoFancy :: MonadIO m => Bool -> String -> m ()
printInfoFancy ansi s = liftIO . hPutStrLn stderr $ applyIf ansi withBoldStr ". " <> s