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

Patat.PrettyPrint

Description

This is a small pretty-printing library.

Synopsis

Documentation

data Doc Source #

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 #

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

Returns the rows and columns necessary to render this document

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

putDoc :: Doc -> IO () Source #

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 #

deindent :: Doc -> Doc Source #

Only strips leading spaces

ansi :: [SGR] -> Doc -> Doc Source #

(<+>) :: Doc -> Doc -> Doc infixr 6 Source #

(<$$>) :: Doc -> Doc -> Doc infixr 5 Source #

vcat :: [Doc] -> Doc Source #

Exotic combinators

data Alignment Source #

Instances

Instances details
Show Alignment Source # 
Instance details

Defined in Patat.PrettyPrint

Eq Alignment Source # 
Instance details

Defined in Patat.PrettyPrint

Ord Alignment Source # 
Instance details

Defined in Patat.PrettyPrint

paste :: [Doc] -> Doc Source #

Like the unix program paste.

Control codes