Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- getConfig :: (Config -> b) -> Printer b
- getOption :: (OptionConfig -> a) -> Printer a
- cut :: Printer a -> Printer a
- oneline :: Printer a -> Printer a
- ignoreOneline :: Printer a -> Printer a
- write :: ByteString -> Printer ()
- string :: String -> Printer ()
- int :: Int -> Printer ()
- space :: Printer ()
- newline :: Printer ()
- blankline :: Printer ()
- spaceOrNewline :: Printer ()
- withTabStops :: [(TabStop, Maybe Int)] -> Printer a -> Printer a
- atTabStop :: TabStop -> Printer ()
- mayM_ :: Maybe a -> (a -> Printer ()) -> Printer ()
- withPrefix :: Applicative f => f a -> (x -> f b) -> x -> f b
- withPostfix :: Applicative f => f a -> (x -> f b) -> x -> f b
- withIndentConfig :: (IndentConfig -> Indent) -> Printer a -> (Int -> Printer a) -> Printer a
- withIndent :: (IndentConfig -> Indent) -> Printer a -> Printer a
- withIndentFlex :: (IndentConfig -> Indent) -> Printer a -> Printer a
- withIndentAfter :: (IndentConfig -> Indent) -> Printer () -> Printer a -> Printer a
- withIndentBy :: (IndentConfig -> Int) -> Printer a -> Printer a
- withLayout :: (LayoutConfig -> Layout) -> Printer a -> Printer a -> Printer a
- inter :: Printer () -> [Printer ()] -> Printer ()
- getNextColumn :: Printer Int
- column :: Int -> Printer a -> Printer a
- aligned :: Printer a -> Printer a
- indented :: Int -> Printer a -> Printer a
- onside :: Printer a -> Printer a
- depend :: ByteString -> Printer a -> Printer a
- depend' :: Printer () -> Printer a -> Printer a
- parens :: Printer () -> Printer ()
- brackets :: Printer () -> Printer ()
- group :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer ()
- groupH :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer ()
- groupV :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer ()
- operator :: LayoutContext -> ByteString -> Printer ()
- operatorH :: LayoutContext -> ByteString -> Printer ()
- operatorV :: LayoutContext -> ByteString -> Printer ()
- alignOnOperator :: LayoutContext -> ByteString -> Printer a -> Printer a
- withOperatorFormatting :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a
- withOperatorFormattingH :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a
- withOperatorFormattingV :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a
- operatorSectionL :: LayoutContext -> ByteString -> Printer () -> Printer ()
- operatorSectionR :: LayoutContext -> ByteString -> Printer () -> Printer ()
- comma :: Printer ()
Documentation
getOption :: (OptionConfig -> a) -> Printer a Source #
Query pretty printer options
cut :: Printer a -> Printer a Source #
Try only the first (i.e. locally best) solution to the given pretty printer. Use this function to improve performance whenever the formatting of an AST node has no effect on the penalty of any following AST node, such as top-level declarations or case branches.
ignoreOneline :: Printer a -> Printer a Source #
Basic printing
write :: ByteString -> Printer () Source #
Write out a string, updating the current position information.
spaceOrNewline :: Printer () Source #
Tab stops
Combinators
withPrefix :: Applicative f => f a -> (x -> f b) -> x -> f b Source #
withPostfix :: Applicative f => f a -> (x -> f b) -> x -> f b Source #
withIndentConfig :: (IndentConfig -> Indent) -> Printer a -> (Int -> Printer a) -> Printer a Source #
withIndent :: (IndentConfig -> Indent) -> Printer a -> Printer a Source #
withIndentFlex :: (IndentConfig -> Indent) -> Printer a -> Printer a Source #
withIndentAfter :: (IndentConfig -> Indent) -> Printer () -> Printer a -> Printer a Source #
withIndentBy :: (IndentConfig -> Int) -> Printer a -> Printer a Source #
withLayout :: (LayoutConfig -> Layout) -> Printer a -> Printer a -> Printer a Source #
Indentation
getNextColumn :: Printer Int Source #
Get the column for the next printed character.
column :: Int -> Printer a -> Printer a Source #
Set the (newline-) indent level to the given column for the given printer.
indented :: Int -> Printer a -> Printer a Source #
Increase indentation level by n spaces for the given printer.
onside :: Printer a -> Printer a Source #
Increase indentation level b n spaces for the given printer, but ignore increase when computing further indentations.
Wrapping
group :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer () Source #
groupH :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer () Source #
groupV :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer () Source #
Operators
operator :: LayoutContext -> ByteString -> Printer () Source #
operatorH :: LayoutContext -> ByteString -> Printer () Source #
operatorV :: LayoutContext -> ByteString -> Printer () Source #
alignOnOperator :: LayoutContext -> ByteString -> Printer a -> Printer a Source #
withOperatorFormatting :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a Source #
withOperatorFormattingH :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a Source #
withOperatorFormattingV :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a Source #
operatorSectionL :: LayoutContext -> ByteString -> Printer () -> Printer () Source #
operatorSectionR :: LayoutContext -> ByteString -> Printer () -> Printer () Source #