rio-prettyprint-0.1.0.0: Pretty-printing for RIO

Safe HaskellNone
LanguageHaskell2010

RIO.PrettyPrint

Contents

Synopsis

Type classes for optionally colored terminal output

class (HasLogFunc env, HasStylesUpdate env) => HasTerm env where Source #

class HasStylesUpdate env where Source #

Environment values with a styles update.

Since: 0.1.0.0

Pretty printing functions

Logging based on pretty-print typeclass

Semantic styling functions

These are used rather than applying colors or other styling directly, to provide consistency.

style :: Style -> StyleDoc -> StyleDoc Source #

Annotate a StyleDoc with a Style.

Formatting utils

bulletedList :: [StyleDoc] -> StyleDoc Source #

Display a bulleted list of StyleDoc.

spacedBulletedList :: [StyleDoc] -> StyleDoc Source #

Display a bulleted list of StyleDoc with a blank line between each.

Re-exports from Text.PrettyPrint.Leijen.Extended

class Pretty a where Source #

Minimal complete definition

Nothing

Methods

pretty :: a -> StyleDoc Source #

pretty :: Show a => a -> StyleDoc Source #

Instances
Pretty ModuleName Source # 
Instance details

Defined in Text.PrettyPrint.Leijen.Extended

Pretty StyleDoc Source # 
Instance details

Defined in Text.PrettyPrint.Leijen.Extended

Pretty (Path b Dir) Source # 
Instance details

Defined in Text.PrettyPrint.Leijen.Extended

Methods

pretty :: Path b Dir -> StyleDoc Source #

Pretty (Path b File) Source # 
Instance details

Defined in Text.PrettyPrint.Leijen.Extended

Methods

pretty :: Path b File -> StyleDoc Source #

data StyleDoc Source #

A document annotated by a style

newtype StyleAnn Source #

A style annotation.

Constructors

StyleAnn (Maybe Style) 

indentAfterLabel :: StyleDoc -> StyleDoc Source #

Use after a label and before the rest of what's being labelled for consistent spacingindentingetc.

For example this is used after "Warning:" in warning messages.

wordDocs :: String -> [StyleDoc] Source #

Make a Doc from each word in a String

flow :: String -> StyleDoc Source #

Wordwrap a String

Re-exports from RIO.PrettyPrint.Types.PrettyPrint

data Style Source #

A style of rio-prettyprint's output.

Instances
Bounded Style Source # 
Instance details

Defined in RIO.PrettyPrint.Types

Enum Style Source # 
Instance details

Defined in RIO.PrettyPrint.Types

Eq Style Source # 
Instance details

Defined in RIO.PrettyPrint.Types

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

Ord Style Source # 
Instance details

Defined in RIO.PrettyPrint.Types

Methods

compare :: Style -> Style -> Ordering #

(<) :: Style -> Style -> Bool #

(<=) :: Style -> Style -> Bool #

(>) :: Style -> Style -> Bool #

(>=) :: Style -> Style -> Bool #

max :: Style -> Style -> Style #

min :: Style -> Style -> Style #

Show Style Source # 
Instance details

Defined in RIO.PrettyPrint.Types

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Ix Style Source # 
Instance details

Defined in RIO.PrettyPrint.Types

Semigroup Style Source #

The first style overrides the second.

Instance details

Defined in RIO.PrettyPrint.Types

Methods

(<>) :: Style -> Style -> Style #

sconcat :: NonEmpty Style -> Style #

stimes :: Integral b => b -> Style -> Style #