ormolu-0.7.4.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Printer.Meat.Declaration.Value

Synopsis

- p_valDecl :: HsBind GhcPs -> R ()
- p_pat :: Pat GhcPs -> R ()
- p_hsExpr :: HsExpr GhcPs -> R ()
- p_hsUntypedSplice :: SpliceDecoration -> HsUntypedSplice GhcPs -> R ()
- p_stringLit :: FastString -> R ()
- data IsApplicand
  - = Applicand
  - | NotApplicand
- p_hsExpr' :: IsApplicand -> BracketStyle -> HsExpr GhcPs -> R ()
- p_hsCmdTop :: BracketStyle -> HsCmdTop GhcPs -> R ()
- exprPlacement :: HsExpr GhcPs -> Placement
- cmdTopPlacement :: HsCmdTop GhcPs -> Placement

# Documentation

p_valDecl :: HsBind GhcPs -> R () #

p_pat :: Pat GhcPs -> R () #

p_hsExpr :: HsExpr GhcPs -> R () #

p_hsUntypedSplice :: SpliceDecoration -> HsUntypedSplice GhcPs -> R () #

p_stringLit :: FastString -> R () #

Print the source text of a string literal while indenting gaps correctly.

data IsApplicand #

An applicand is the left-hand side in a function application, i.e. `f` in `f a`. We need to track this in order to add extra identation in cases like

    foo =
      do
          succ
        1

Constructors

Applicand |
NotApplicand |

p_hsExpr' :: IsApplicand -> BracketStyle -> HsExpr GhcPs -> R () #

p_hsCmdTop :: BracketStyle -> HsCmdTop GhcPs -> R () #

Print a top-level command.

exprPlacement :: HsExpr GhcPs -> Placement #

Check if given expression has a hanging form.

cmdTopPlacement :: HsCmdTop GhcPs -> Placement #

Determine placement of a top level command.