hindent-5.3.1: Extensible Haskell pretty printer
Safe HaskellNone
LanguageHaskell98

HIndent.Types

Description

All types.

Synopsis

Documentation

newtype Printer a Source #

A pretty printing monad.

Constructors

Printer 

Fields

Instances

Instances details
Monad Printer Source # 
Instance details

Defined in HIndent.Types

Methods

(>>=) :: Printer a -> (a -> Printer b) -> Printer b

(>>) :: Printer a -> Printer b -> Printer b

return :: a -> Printer a

Functor Printer Source # 
Instance details

Defined in HIndent.Types

Methods

fmap :: (a -> b) -> Printer a -> Printer b

(<$) :: a -> Printer b -> Printer a

Applicative Printer Source # 
Instance details

Defined in HIndent.Types

Methods

pure :: a -> Printer a

(<*>) :: Printer (a -> b) -> Printer a -> Printer b

liftA2 :: (a -> b -> c) -> Printer a -> Printer b -> Printer c

(*>) :: Printer a -> Printer b -> Printer b

(<*) :: Printer a -> Printer b -> Printer a

MonadPlus Printer Source # 
Instance details

Defined in HIndent.Types

Methods

mzero :: Printer a

mplus :: Printer a -> Printer a -> Printer a

Alternative Printer Source # 
Instance details

Defined in HIndent.Types

Methods

empty :: Printer a

(<|>) :: Printer a -> Printer a -> Printer a

some :: Printer a -> Printer [a]

many :: Printer a -> Printer [a]

MonadState PrintState Printer Source # 
Instance details

Defined in HIndent.Types

data PrintState Source #

The state of the pretty printer.

Constructors

PrintState 

Fields

  • psIndentLevel :: !Int64

    Current indentation level, i.e. every time there's a new-line, output this many spaces.

  • psOutput :: !Builder

    The current output bytestring builder.

  • psNewline :: !Bool

    Just outputted a newline?

  • psColumn :: !Int64

    Current column.

  • psLine :: !Int64

    Current line number.

  • psConfig :: !Config

    Configuration of max colums and indentation style.

  • psInsideCase :: !Bool

    Whether we're in a case statement, used for Rhs printing.

  • psFitOnOneLine :: !Bool

    Bail out if we need to print beyond the current line or the maximum column.

  • psEolComment :: !Bool
     

Instances

Instances details
MonadState PrintState Printer Source # 
Instance details

Defined in HIndent.Types

data Config Source #

Configurations shared among the different styles. Styles may pay attention to or completely disregard this configuration.

Constructors

Config 

Fields

Instances

Instances details
FromJSON Config Source # 
Instance details

Defined in HIndent.Types

readExtension :: MonadFail m => String -> m Extension Source #

Parse an extension.

defaultConfig :: Config Source #

Default style configuration.

data NodeInfo Source #

Information for each node in the AST.

Constructors

NodeInfo 

Fields

Instances

Instances details
Show NodeInfo Source # 
Instance details

Defined in HIndent.Types

Methods

showsPrec :: Int -> NodeInfo -> ShowS

show :: NodeInfo -> String

showList :: [NodeInfo] -> ShowS

data NodeComment Source #

Comment associated with a node. SrcSpan is the original source span of the comment.

Instances

Instances details
Eq NodeComment Source # 
Instance details

Defined in HIndent.Types

Methods

(==) :: NodeComment -> NodeComment -> Bool

(/=) :: NodeComment -> NodeComment -> Bool

Ord NodeComment Source # 
Instance details

Defined in HIndent.Types

Show NodeComment Source # 
Instance details

Defined in HIndent.Types

Methods

showsPrec :: Int -> NodeComment -> ShowS

show :: NodeComment -> String

showList :: [NodeComment] -> ShowS

data SomeComment Source #

Some comment to print.

Constructors

EndOfLine String 
MultiLine String 

Instances

Instances details
Eq SomeComment Source # 
Instance details

Defined in HIndent.Types

Methods

(==) :: SomeComment -> SomeComment -> Bool

(/=) :: SomeComment -> SomeComment -> Bool

Ord SomeComment Source # 
Instance details

Defined in HIndent.Types

Show SomeComment Source # 
Instance details

Defined in HIndent.Types

Methods

showsPrec :: Int -> SomeComment -> ShowS

show :: SomeComment -> String

showList :: [SomeComment] -> ShowS