pretty-ghci-0.1.0.0: Functionality for beautifying GHCi

Safe HaskellNone
LanguageHaskell2010

Text.PrettyPrint.GHCi

Contents

Synopsis

Interactive expression printing

prettyPrintValue :: Bool -> String -> IO () Source #

Given a Show-ed value, print that value out to the terminal, add helpful indentation and colours whenever possible. If a structured value cannot be parsed out, this falls back on print.

The Bool is to enable a slower but potentially smarter layout algorithm.

value2Doc :: String -> Doc AnsiStyle Source #

Parse a shown value into a pretty Doc. Can throw an error on outputs that could not be parsed properly, but should not throw errors for inputs which are the outputs of show from derived Show instances.

data ValuePrintConf Source #

Options for how to colour the terminal output

Constructors

ValuePrintConf 

Fields

defaultValueConf :: ValuePrintConf Source #

A Good Enough colour scheme

Interactive doc string printing

prettyPrintHaddock :: Bool -> String -> IO () Source #

Given a Haddock-formatted docstring, format and print that docstring to the terminal.

The Bool is to enable a slower but potentially smarter layout algorithm.

haddock2Doc :: String -> Doc AnsiStyle Source #

Parse a docstring into a pretty Doc. Should never throw an exception (since haddock-library will parse something out of any input).

data HaddockPrintConf Source #

Options for how to colour the terminal output

Constructors

HaddockPrintConf 

Fields

defaultHaddockConf :: HaddockPrintConf Source #

A Good Enough colour scheme

Formatting options

Color

data Color #

Constructors

Black 
Red 
Green 
Yellow 
Blue 
Magenta 
Cyan 
White 
Instances
Eq Color 
Instance details

Defined in Data.Text.Prettyprint.Doc.Render.Terminal.Internal

Methods

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

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

Ord Color 
Instance details

Defined in Data.Text.Prettyprint.Doc.Render.Terminal.Internal

Methods

compare :: Color -> Color -> Ordering #

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

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

(>) :: Color -> Color -> Bool #

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

max :: Color -> Color -> Color #

min :: Color -> Color -> Color #

Show Color 
Instance details

Defined in Data.Text.Prettyprint.Doc.Render.Terminal.Internal

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

Style