Safe Haskell | None |
---|---|
Language | Haskell98 |
Stub module for Johan Tibell's style.
Documented here: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
Questions:
How to indent after a guarded alt/rhs? How to indent let? How to indent large ADT constructors types?
- shortName :: Int64
- data State = State
- johanTibell :: Style
- stmt :: Stmt NodeInfo -> Printer s ()
- dependOrNewline :: Printer t () -> Exp NodeInfo -> (Exp NodeInfo -> Printer t ()) -> Printer t ()
- rhs :: Rhs NodeInfo -> Printer s ()
- guardedRhs :: GuardedRhs NodeInfo -> Printer s ()
- exp :: Exp NodeInfo -> Printer s ()
- match :: Match NodeInfo -> Printer s ()
- context :: Context NodeInfo -> Printer s ()
- unboxParens :: MonadState (PrintState s) m => m a -> m a
- typ :: Type NodeInfo -> Printer s ()
- decl :: Decl NodeInfo -> Printer s ()
- qualConDecl :: QualConDecl NodeInfo -> Printer s ()
- conDecl :: ConDecl NodeInfo -> Printer s ()
- recDecl :: ConDecl NodeInfo -> Printer s ()
- recUpdateExpr :: Printer s () -> [FieldUpdate NodeInfo] -> Printer s ()
- isRecord :: QualConDecl t -> Bool
- isOverflow :: MonadState (PrintState s) m => m a -> m Bool
- fitsOnOneLine :: MonadState (PrintState s) m => m a -> m (Bool, PrintState s)
- isSingleLiner :: MonadState (PrintState s) m => m a -> m Bool
- isShort :: Pretty ast => ast NodeInfo -> Printer s Bool
- isFlat :: Exp NodeInfo -> Printer s Bool
- fieldupdate :: FieldUpdate NodeInfo -> Printer s ()
- isSmall :: MonadState (PrintState t) m => m a -> m Bool
- bindingGroup :: Binds NodeInfo -> Printer s ()
Documentation
The printer style.
dependOrNewline :: Printer t () -> Exp NodeInfo -> (Exp NodeInfo -> Printer t ()) -> Printer t () Source
Make the right hand side dependent if it fits on one line, otherwise send it to the next line.
rhs :: Rhs NodeInfo -> Printer s () Source
Handle do and case specially and also space out guards more.
guardedRhs :: GuardedRhs NodeInfo -> Printer s () Source
Handle do specially.
Implement dangling right-hand-sides.
context :: Context NodeInfo -> Printer s () Source
Format contexts with spaces and commas between class constraints.
unboxParens :: MonadState (PrintState s) m => m a -> m a Source
decl :: Decl NodeInfo -> Printer s () Source
Pretty print type signatures like
foo :: (Show x, Read x) => (Foo -> Bar) -> Maybe Int -> (Char -> X -> Y) -> IO ()
Specially format records. Indent where clauses only 2 spaces.
qualConDecl :: QualConDecl NodeInfo -> Printer s () Source
Use special record display, used by dataDecl
in a record scenario.
recUpdateExpr :: Printer s () -> [FieldUpdate NodeInfo] -> Printer s () Source
isRecord :: QualConDecl t -> Bool Source
Is the decl a record?
isOverflow :: MonadState (PrintState s) m => m a -> m Bool Source
Does printing the given thing overflow column limit? (e.g. 80)
fitsOnOneLine :: MonadState (PrintState s) m => m a -> m (Bool, PrintState s) Source
Does printing the given thing overflow column limit? (e.g. 80)
isSingleLiner :: MonadState (PrintState s) m => m a -> m Bool Source
Is the given expression a single-liner when printed?
isShort :: Pretty ast => ast NodeInfo -> Printer s Bool Source
Is the expression "short"? Used for app heads.
fieldupdate :: FieldUpdate NodeInfo -> Printer s () Source
rhs on field update on the same line as lhs.
isSmall :: MonadState (PrintState t) m => m a -> m Bool Source
bindingGroup :: Binds NodeInfo -> Printer s () Source