ormolu-0.1.4.1: A formatter for Haskell source code
Safe HaskellNone
LanguageHaskell2010

Ormolu.Terminal

Description

An abstraction for colorful output in terminal.

Synopsis

The Term monad

data Term a Source #

Terminal monad.

Instances

Instances details
Monad Term Source # 
Instance details

Defined in Ormolu.Terminal

Methods

(>>=) :: Term a -> (a -> Term b) -> Term b

(>>) :: Term a -> Term b -> Term b

return :: a -> Term a

Functor Term Source # 
Instance details

Defined in Ormolu.Terminal

Methods

fmap :: (a -> b) -> Term a -> Term b

(<$) :: a -> Term b -> Term a

Applicative Term Source # 
Instance details

Defined in Ormolu.Terminal

Methods

pure :: a -> Term a

(<*>) :: Term (a -> b) -> Term a -> Term b

liftA2 :: (a -> b -> c) -> Term a -> Term b -> Term c

(*>) :: Term a -> Term b -> Term b

(<*) :: Term a -> Term b -> Term a

data ColorMode Source #

Whether to use colors and other features of ANSI terminals.

Constructors

Never 
Always 
Auto 

Instances

Instances details
Eq ColorMode Source # 
Instance details

Defined in Ormolu.Terminal

Methods

(==) :: ColorMode -> ColorMode -> Bool

(/=) :: ColorMode -> ColorMode -> Bool

Show ColorMode Source # 
Instance details

Defined in Ormolu.Terminal

Methods

showsPrec :: Int -> ColorMode -> ShowS

show :: ColorMode -> String

showList :: [ColorMode] -> ShowS

runTerm Source #

Arguments

:: Term a

Monad to run

-> ColorMode

Color mode

-> Handle

Handle to print to

-> IO a 

Run Term monad.

Styling

bold :: Term a -> Term a Source #

Make the inner computation output bold text.

cyan :: Term a -> Term a Source #

Make the inner computation output cyan text.

green :: Term a -> Term a Source #

Make the inner computation output green text.

red :: Term a -> Term a Source #

Make the inner computation output red text.

Printing

put :: Text -> Term () Source #

Output Text.

putS :: String -> Term () Source #

Output String.

putSrcSpan :: SrcSpan -> Term () Source #

Output a SrcSpan.

newline :: Term () Source #

Output a newline.