Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- getConfig :: (Config -> b) -> Printer b
- getOption :: (OptionConfig -> a) -> Printer a
- cut :: Printer a -> Printer a
- closeEolComment :: Printer ()
- oneline :: Printer a -> Printer a
- ignoreOneline :: Printer a -> Printer a
- write :: Text -> Printer ()
- string :: String -> Printer ()
- int :: Int -> Printer ()
- space :: Printer ()
- newline :: Printer ()
- ensureNewline :: 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
- suppressOnside :: Printer () -> Printer ()
- depend :: Text -> Printer a -> Printer a
- depend' :: Printer () -> Printer a -> Printer a
- parens :: Printer () -> Printer ()
- brackets :: Printer () -> Printer ()
- group :: LayoutContext -> Text -> Text -> Printer () -> Printer ()
- groupH :: LayoutContext -> Text -> Text -> Printer () -> Printer ()
- groupV :: LayoutContext -> Text -> Text -> Printer () -> Printer ()
- operator :: LayoutContext -> Text -> Printer ()
- operatorH :: LayoutContext -> Text -> Printer ()
- operatorV :: LayoutContext -> Text -> Printer ()
- alignOnOperator :: LayoutContext -> Text -> Printer a -> Printer a
- withOperatorFormatting :: LayoutContext -> Text -> Printer () -> (Printer () -> Printer a) -> Printer a
- withOperatorFormattingH :: LayoutContext -> Text -> Printer () -> (Printer () -> Printer a) -> Printer a
- withOperatorFormattingV :: LayoutContext -> Text -> Printer () -> (Printer () -> Printer a) -> Printer a
- operatorSectionL :: LayoutContext -> Text -> Printer () -> Printer ()
- operatorSectionR :: LayoutContext -> Text -> 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.
closeEolComment :: Printer () Source #
ignoreOneline :: Printer a -> Printer a Source #
Basic printing
ensureNewline :: Printer () Source #
Output a newline if not at the start of a line
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 by n spaces for the given printer, but ignore increase when computing further indentations.
suppressOnside :: Printer () -> Printer () Source #
Temporarily ignore any onside identation.
Wrapping
Operators
alignOnOperator :: LayoutContext -> Text -> Printer a -> Printer a Source #
withOperatorFormatting :: LayoutContext -> Text -> Printer () -> (Printer () -> Printer a) -> Printer a Source #
withOperatorFormattingH :: LayoutContext -> Text -> Printer () -> (Printer () -> Printer a) -> Printer a Source #
withOperatorFormattingV :: LayoutContext -> Text -> Printer () -> (Printer () -> Printer a) -> Printer a Source #
operatorSectionL :: LayoutContext -> Text -> Printer () -> Printer () Source #
operatorSectionR :: LayoutContext -> Text -> Printer () -> Printer () Source #