patat-0.8.9.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

Methods

fromString :: String -> Doc #

Monoid Doc Source # 
Instance details

Defined in Patat.PrettyPrint

Methods

mempty :: Doc #

mappend :: Doc -> Doc -> Doc #

mconcat :: [Doc] -> Doc #

Semigroup Doc Source # 
Instance details

Defined in Patat.PrettyPrint

Methods

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

sconcat :: NonEmpty Doc -> Doc #

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

Show Doc Source # 
Instance details

Defined in Patat.PrettyPrint

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 Trimmable a Source #

Constructors

NotTrimmable !a 
Trimmable !a 

Instances

Instances details
Foldable Trimmable Source # 
Instance details

Defined in Patat.PrettyPrint

Methods

fold :: Monoid m => Trimmable m -> m #

foldMap :: Monoid m => (a -> m) -> Trimmable a -> m #

foldMap' :: Monoid m => (a -> m) -> Trimmable a -> m #

foldr :: (a -> b -> b) -> b -> Trimmable a -> b #

foldr' :: (a -> b -> b) -> b -> Trimmable a -> b #

foldl :: (b -> a -> b) -> b -> Trimmable a -> b #

foldl' :: (b -> a -> b) -> b -> Trimmable a -> b #

foldr1 :: (a -> a -> a) -> Trimmable a -> a #

foldl1 :: (a -> a -> a) -> Trimmable a -> a #

toList :: Trimmable a -> [a] #

null :: Trimmable a -> Bool #

length :: Trimmable a -> Int #

elem :: Eq a => a -> Trimmable a -> Bool #

maximum :: Ord a => Trimmable a -> a #

minimum :: Ord a => Trimmable a -> a #

sum :: Num a => Trimmable a -> a #

product :: Num a => Trimmable a -> a #

Traversable Trimmable Source # 
Instance details

Defined in Patat.PrettyPrint

Methods

traverse :: Applicative f => (a -> f b) -> Trimmable a -> f (Trimmable b) #

sequenceA :: Applicative f => Trimmable (f a) -> f (Trimmable a) #

mapM :: Monad m => (a -> m b) -> Trimmable a -> m (Trimmable b) #

sequence :: Monad m => Trimmable (m a) -> m (Trimmable a) #

Functor Trimmable Source # 
Instance details

Defined in Patat.PrettyPrint

Methods

fmap :: (a -> b) -> Trimmable a -> Trimmable b #

(<$) :: a -> Trimmable b -> Trimmable a #

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