Safe Haskell | None |
---|---|
Language | Haskell2010 |
Patat.PrettyPrint
Contents
Description
This is a small pretty-printing library.
Synopsis
- data Doc
- toString :: Doc -> String
- dimensions :: Doc -> (Int, Int)
- null :: Doc -> Bool
- hPutDoc :: Handle -> Doc -> IO ()
- putDoc :: Doc -> IO ()
- char :: Char -> Doc
- string :: String -> Doc
- text :: Text -> Doc
- space :: Doc
- spaces :: Int -> Doc
- softline :: Doc
- hardline :: Doc
- wrapAt :: Maybe Int -> Doc -> Doc
- data Indentation a = Indentation Int a
- indent :: Indentation Doc -> Indentation Doc -> Doc -> Doc
- deindent :: Doc -> Doc
- ansi :: [SGR] -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- (<$$>) :: Doc -> Doc -> Doc
- vcat :: [Doc] -> Doc
- intersperse :: Doc -> [Doc] -> Doc
- data Alignment
- align :: Int -> Alignment -> Doc -> Doc
- paste :: [Doc] -> Doc
- removeControls :: Doc -> Doc
- clearScreen :: Doc
- goToLine :: Int -> Doc
Documentation
dimensions :: Doc -> (Int, Int) Source #
Returns the rows and columns necessary to render this document
data Indentation a Source #
Constructors
Indentation Int a |
Instances
Foldable Indentation Source # | |
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 # | |
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 # | |
Defined in Patat.PrettyPrint.Internal Methods fmap :: (a -> b) -> Indentation a -> Indentation b (<$) :: a -> Indentation b -> Indentation a |
indent :: Indentation Doc -> Indentation Doc -> Doc -> Doc Source #
Exotic combinators
Constructors
AlignLeft | |
AlignCenter | |
AlignRight |
Control codes
removeControls :: Doc -> Doc Source #
clearScreen :: Doc Source #