hindent-4.1.0: Extensible Haskell pretty printer

Safe HaskellNone



Stub module for Johan Tibell's style.

Documented here: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md


How to indent after a guarded alt/rhs? How to indent let? How to indent large ADT constructors types?



shortName :: Int64 Source

A short function name.

data State Source

Empty state.



johanTibell :: Style Source

The printer style.

rhs :: t -> Rhs NodeInfo -> Printer () Source

Handle do specially and also space out guards more.

guardedRhs :: t -> GuardedRhs NodeInfo -> Printer () Source

Handle do specially.

Implement dangling right-hand-sides.

exp :: t -> Exp NodeInfo -> Printer () Source

Space out tuples.

Expression customizations.

decl :: t -> Decl NodeInfo -> Printer () Source

Specially format records. Indent where clauses only 2 spaces.

qualConDecl :: QualConDecl NodeInfo -> Printer () Source

Use special record display, used by dataDecl in a record scenario.

conDecl :: t -> ConDecl NodeInfo -> Printer () Source

Fields are preceded with a space.

isRecord :: QualConDecl t -> Bool Source

Is the decl a record?

isOverflow :: Printer a -> Printer Bool Source

Does printing the given thing overflow column limit? (e.g. 80)

isSingleLiner :: MonadState PrintState m => m a -> m Bool Source

Is the given expression a single-liner when printed?

isShort :: Pretty ast => ast NodeInfo -> Printer Bool Source

Is the expression "short"? Used for app heads.

isFlat :: Exp NodeInfo -> Printer Bool Source

Is an expression flat?

fieldupdate :: t -> FieldUpdate NodeInfo -> Printer () Source

rhs on field update on the same line as lhs.

infixApp :: (Pretty ast, Pretty ast1, Pretty ast2) => Exp NodeInfo -> ast NodeInfo -> ast1 NodeInfo -> ast2 NodeInfo -> Maybe Int64 -> Printer () Source

recDecl :: ConDecl NodeInfo -> Printer () Source

Record decls are formatted like: Foo { bar :: X }