-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Extensible Haskell pretty printer
--   
--   Extensible Haskell pretty printer. Both a library and an executable.
--   
--   See the Github page for usage/explanation:
--   <a>https://github.com/commercialhaskell/hindent</a>
@package hindent
@version 5.2.3


-- | All types.
module HIndent.Types

-- | A pretty printing monad.
newtype Printer a
Printer :: StateT PrintState (MaybeT Identity) a -> Printer a
[runPrinter] :: Printer a -> StateT PrintState (MaybeT Identity) a

-- | The state of the pretty printer.
data PrintState
PrintState :: !Int64 -> !Builder -> !Bool -> !Int64 -> !Int64 -> !Config -> !Bool -> !Bool -> !Bool -> PrintState

-- | Current indentation level, i.e. every time there's a new-line, output
--   this many spaces.
[psIndentLevel] :: PrintState -> !Int64

-- | The current output bytestring builder.
[psOutput] :: PrintState -> !Builder

-- | Just outputted a newline?
[psNewline] :: PrintState -> !Bool

-- | Current column.
[psColumn] :: PrintState -> !Int64

-- | Current line number.
[psLine] :: PrintState -> !Int64

-- | Configuration of max colums and indentation style.
[psConfig] :: PrintState -> !Config

-- | Whether we're in a case statement, used for Rhs printing.
[psInsideCase] :: PrintState -> !Bool

-- | Bail out if we exceed current column.
[psHardLimit] :: PrintState -> !Bool
[psEolComment] :: PrintState -> !Bool

-- | Configurations shared among the different styles. Styles may pay
--   attention to or completely disregard this configuration.
data Config
Config :: !Int64 -> !Int64 -> !Bool -> !Bool -> [String] -> Config

-- | Maximum columns to fit code into ideally.
[configMaxColumns] :: Config -> !Int64

-- | How many spaces to indent?
[configIndentSpaces] :: Config -> !Int64

-- | End with a newline.
[configTrailingNewline] :: Config -> !Bool

-- | Sort imports in groups.
[configSortImports] :: Config -> !Bool

-- | Break line when meets these operators.
[configLineBreaks] :: Config -> [String]

-- | Default style configuration.
defaultConfig :: Config

-- | Information for each node in the AST.
data NodeInfo
NodeInfo :: !SrcSpanInfo -> ![NodeComment] -> NodeInfo

-- | Location info from the parser.
[nodeInfoSpan] :: NodeInfo -> !SrcSpanInfo

-- | Comments attached to this node.
[nodeInfoComments] :: NodeInfo -> ![NodeComment]

-- | Comment associated with a node. <a>SrcSpan</a> is the original source
--   span of the comment.
data NodeComment
CommentSameLine :: SrcSpan -> SomeComment -> NodeComment
CommentAfterLine :: SrcSpan -> SomeComment -> NodeComment
CommentBeforeLine :: SrcSpan -> SomeComment -> NodeComment

-- | Some comment to print.
data SomeComment
EndOfLine :: String -> SomeComment
MultiLine :: String -> SomeComment
instance GHC.Classes.Eq HIndent.Types.NodeComment
instance GHC.Classes.Ord HIndent.Types.NodeComment
instance GHC.Show.Show HIndent.Types.NodeComment
instance GHC.Classes.Eq HIndent.Types.SomeComment
instance GHC.Classes.Ord HIndent.Types.SomeComment
instance GHC.Show.Show HIndent.Types.SomeComment
instance GHC.Base.Alternative HIndent.Types.Printer
instance GHC.Base.MonadPlus HIndent.Types.Printer
instance Control.Monad.State.Class.MonadState HIndent.Types.PrintState HIndent.Types.Printer
instance GHC.Base.Functor HIndent.Types.Printer
instance GHC.Base.Monad HIndent.Types.Printer
instance GHC.Base.Applicative HIndent.Types.Printer
instance Data.Aeson.Types.FromJSON.FromJSON HIndent.Types.Config
instance GHC.Show.Show HIndent.Types.NodeInfo


-- | Pretty printing.
module HIndent.Pretty

-- | Pretty print including comments.
pretty :: (Pretty ast, Show (ast NodeInfo)) => ast NodeInfo -> Printer ()
instance GHC.Show.Show l => GHC.Show.Show (HIndent.Pretty.OpChainLink l)
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Context
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Pat
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Type
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Exp
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.IPName
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Stmt
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.QualStmt
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Decl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.TypeEqn
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Deriving
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Alt
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Asst
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.BangType
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Unpackedness
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Binds
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ClassDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ConDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.FieldDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.FieldUpdate
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.GuardedRhs
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.InjectivityInfo
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.InstDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Match
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.PatField
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.QualConDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.GadtDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Rhs
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Splice
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.InstRule
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.InstHead
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.DeclHead
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Overlap
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Sign
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Module
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Bracket
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.IPBind
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.BooleanFormula
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.DataOrNew
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.FunDep
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Kind
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ResultSig
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Literal
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.Name
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.QName
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.SpecialCon
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.QOp
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.TyVarBind
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ModuleHead
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ModulePragma
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ImportDecl
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ModuleName
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ImportSpecList
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ImportSpec
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.WarningText
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ExportSpecList
instance HIndent.Pretty.Pretty Language.Haskell.Exts.Syntax.ExportSpec


-- | Haskell indenter.
module HIndent

-- | Format the given source.
reformat :: Config -> Maybe [Extension] -> Maybe FilePath -> ByteString -> Either String Builder

-- | Print the module.
prettyPrint :: Config -> Module SrcSpanInfo -> [Comment] -> Either a Builder

-- | Parse mode, includes all extensions, doesn't assume any fixities.
parseMode :: ParseMode

-- | Test with the given style, prints to stdout.
test :: ByteString -> IO ()

-- | Test the given file.
testFile :: FilePath -> IO ()

-- | Parse the source and annotate it with comments, yielding the resulting
--   AST.
testAst :: ByteString -> Either String (Module NodeInfo)

-- | Test the given file.
testFileAst :: FilePath -> IO ()

-- | Default extensions.
defaultExtensions :: [Extension]

-- | Consume an extensions list from arguments.
getExtensions :: [Text] -> [Extension]
instance GHC.Classes.Eq HIndent.CodeBlock
instance GHC.Show.Show HIndent.CodeBlock
