Safe Haskell | None |
---|---|
Language | Haskell98 |
HIndent.Types
Description
All types.
Synopsis
- newtype Printer a = Printer {
- runPrinter :: StateT PrintState (MaybeT Identity) a
- data PrintState = PrintState {
- psIndentLevel :: !Int64
- psOutput :: !Builder
- psNewline :: !Bool
- psColumn :: !Int64
- psLine :: !Int64
- psConfig :: !Config
- psInsideCase :: !Bool
- psFitOnOneLine :: !Bool
- psEolComment :: !Bool
- data Config = Config {
- configMaxColumns :: !Int64
- configIndentSpaces :: !Int64
- configTrailingNewline :: !Bool
- configSortImports :: !Bool
- configLineBreaks :: [String]
- configExtensions :: [Extension]
- readExtension :: MonadFail m => String -> m Extension
- defaultConfig :: Config
- data NodeInfo = NodeInfo {}
- data NodeComment
- data SomeComment
Documentation
A pretty printing monad.
Constructors
Printer | |
Fields
|
Instances
Monad Printer Source # | |
Functor Printer Source # | |
Applicative Printer Source # | |
MonadPlus Printer Source # | |
Alternative Printer Source # | |
MonadState PrintState Printer Source # | |
Defined in HIndent.Types Methods get :: Printer PrintState put :: PrintState -> Printer () state :: (PrintState -> (a, PrintState)) -> Printer a |
data PrintState Source #
The state of the pretty printer.
Constructors
PrintState | |
Fields
|
Instances
MonadState PrintState Printer Source # | |
Defined in HIndent.Types Methods get :: Printer PrintState put :: PrintState -> Printer () state :: (PrintState -> (a, PrintState)) -> Printer a |
Configurations shared among the different styles. Styles may pay attention to or completely disregard this configuration.
Constructors
Config | |
Fields
|
readExtension :: MonadFail m => String -> m Extension Source #
Parse an extension.
defaultConfig :: Config Source #
Default style configuration.
Information for each node in the AST.
Constructors
NodeInfo | |
Fields
|
data NodeComment Source #
Comment associated with a node.
SrcSpan
is the original source span of the comment.
Constructors
CommentSameLine SrcSpan SomeComment | |
CommentAfterLine SrcSpan SomeComment | |
CommentBeforeLine SrcSpan SomeComment |
Instances
Eq NodeComment Source # | |
Defined in HIndent.Types | |
Ord NodeComment Source # | |
Defined in HIndent.Types Methods compare :: NodeComment -> NodeComment -> Ordering (<) :: NodeComment -> NodeComment -> Bool (<=) :: NodeComment -> NodeComment -> Bool (>) :: NodeComment -> NodeComment -> Bool (>=) :: NodeComment -> NodeComment -> Bool max :: NodeComment -> NodeComment -> NodeComment min :: NodeComment -> NodeComment -> NodeComment | |
Show NodeComment Source # | |
Defined in HIndent.Types Methods showsPrec :: Int -> NodeComment -> ShowS show :: NodeComment -> String showList :: [NodeComment] -> ShowS |
data SomeComment Source #
Some comment to print.
Instances
Eq SomeComment Source # | |
Defined in HIndent.Types | |
Ord SomeComment Source # | |
Defined in HIndent.Types Methods compare :: SomeComment -> SomeComment -> Ordering (<) :: SomeComment -> SomeComment -> Bool (<=) :: SomeComment -> SomeComment -> Bool (>) :: SomeComment -> SomeComment -> Bool (>=) :: SomeComment -> SomeComment -> Bool max :: SomeComment -> SomeComment -> SomeComment min :: SomeComment -> SomeComment -> SomeComment | |
Show SomeComment Source # | |
Defined in HIndent.Types Methods showsPrec :: Int -> SomeComment -> ShowS show :: SomeComment -> String showList :: [SomeComment] -> ShowS |