patat-0.11.0.0: Terminal-based presentations using Pandoc
Safe HaskellSafe-Inferred
LanguageHaskell2010

Patat.PrettyPrint.Internal

Description

This is a small pretty-printing library.

Synopsis

Documentation

data Control Source #

Control actions for the terminal.

Instances

Instances details
Show Control Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

showsPrec :: Int -> Control -> ShowS

show :: Control -> String

showList :: [Control] -> ShowS

Eq Control Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

(==) :: Control -> Control -> Bool

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

data Chunk Source #

A simple chunk of text. All ANSI codes are "reset" after printing.

Constructors

StringChunk [SGR] String 
NewlineChunk 
ControlChunk Control 

Instances

Instances details
Show Chunk Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

showsPrec :: Int -> Chunk -> ShowS

show :: Chunk -> String

showList :: [Chunk] -> ShowS

Eq Chunk Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

(==) :: Chunk -> Chunk -> Bool

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

type Chunks = [Chunk] Source #

data DocE d Source #

Constructors

String String 
Softspace 
Hardspace 
Softline 
Hardline 
WrapAt 

Fields

Ansi 

Fields

Indent 
Control Control 

Instances

Instances details
Functor DocE Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

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

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

data Indentation a Source #

Constructors

Indentation Int a 

Instances

Instances details
Foldable Indentation Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

fold :: Monoid m => Indentation m -> m

foldMap :: Monoid m => (a -> m) -> Indentation a -> m

foldMap' :: Monoid m => (a -> m) -> Indentation a -> m

foldr :: (a -> b -> b) -> b -> Indentation a -> b

foldr' :: (a -> b -> b) -> b -> Indentation a -> b

foldl :: (b -> a -> b) -> b -> Indentation a -> b

foldl' :: (b -> a -> b) -> b -> Indentation a -> b

foldr1 :: (a -> a -> a) -> Indentation a -> a

foldl1 :: (a -> a -> a) -> Indentation a -> a

toList :: Indentation a -> [a]

null :: Indentation a -> Bool

length :: Indentation a -> Int

elem :: Eq a => a -> Indentation a -> Bool

maximum :: Ord a => Indentation a -> a

minimum :: Ord a => Indentation a -> a

sum :: Num a => Indentation a -> a

product :: Num a => Indentation a -> a

Traversable Indentation Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Indentation a -> f (Indentation b)

sequenceA :: Applicative f => Indentation (f a) -> f (Indentation a)

mapM :: Monad m => (a -> m b) -> Indentation a -> m (Indentation b)

sequence :: Monad m => Indentation (m a) -> m (Indentation a)

Functor Indentation Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

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

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

newtype Doc Source #

Constructors

Doc 

Fields

Instances

Instances details
IsString Doc Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

fromString :: String -> Doc

Monoid Doc Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

mempty :: Doc

mappend :: Doc -> Doc -> Doc

mconcat :: [Doc] -> Doc

Semigroup Doc Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

(<>) :: Doc -> Doc -> Doc

sconcat :: NonEmpty Doc -> Doc

stimes :: Integral b => b -> Doc -> Doc

Show Doc Source # 
Instance details

Defined in Patat.PrettyPrint.Internal

Methods

showsPrec :: Int -> Doc -> ShowS

show :: Doc -> String

showList :: [Doc] -> ShowS

toString :: Doc -> String Source #

dimensions :: Doc -> (Int, Int) Source #

Returns the rows and columns necessary to render this document

null :: Doc -> Bool Source #

hPutDoc :: Handle -> Doc -> IO () Source #

putDoc :: Doc -> IO () Source #

string :: String -> Doc Source #