hindent-4.3.7: Extensible Haskell pretty printer

Safe HaskellNone
LanguageHaskell98

HIndent

Contents

Description

Haskell indenter.

Synopsis

Formatting functions.

reformat :: Style -> Maybe [Extension] -> Text -> Either String Builder Source

Format the given source.

prettyPrint :: Style -> (forall s. Printer s ()) -> Builder Source

Pretty print the given printable thing.

parseMode :: ParseMode Source

Parse mode, includes all extensions, doesn't assume any fixities.

Style

data Style Source

A printer style.

Constructors

forall s . Style 

Fields

styleName :: !Text

Name of the style, used in the commandline interface.

styleAuthor :: !Text

Author of the printer (as opposed to the author of the style).

styleDescription :: !Text

Description of the style.

styleInitialState :: !s

User state, if needed.

styleExtenders :: ![Extender s]

Extenders to the printer.

styleDefConfig :: !Config

Default config to use for this style.

styles :: [Style] Source

Styles list, useful for programmatically choosing.

chrisDone :: Style Source

The printer style.

johanTibell :: Style Source

The printer style.

fundamental :: Style Source

The printer style.

gibiansky :: Style Source

The printer style.

Testing

test :: Style -> Text -> IO () Source

Test with the given style, prints to stdout.

testAll :: Text -> IO () Source

Test with all styles, prints to stdout.

testAst :: Text -> Either String ([ComInfo], Module NodeInfo) Source

Parse the source and annotate it with comments, yielding the resulting AST.