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

-- | Support for manipulating Haskell source code
--   
--   The haskell-src package provides support for manipulating
--   Haskell source code. The package provides a lexer, parser and
--   pretty-printer, and a definition of a Haskell abstract syntax tree
--   (AST). Common uses of this package are to parse or generate Haskell
--   98 code.
@package haskell-src
@version 1.0.4.2

-- | A suite of datatypes describing the abstract syntax of Haskell
--   98 plus a few extensions:
--   
--   
--   
- multi-parameter type classes
--   
- parameters of type class assertions are unrestricted
--   
--   
--   For GHC, we also derive Data for all types.
module Language.Haskell.Syntax

-- | A Haskell source module.
data HsModule
HsModule :: SrcLoc -> Module -> Maybe [HsExportSpec] -> [HsImportDecl] -> [HsDecl] -> HsModule

-- | Export specification.
data HsExportSpec

-- | Variable.
HsEVar :: HsQName -> HsExportSpec

-- | T: A class or datatype exported abstractly, or a type
--   synonym.
HsEAbs :: HsQName -> HsExportSpec

-- | T(..): A class exported with all of its methods, or a
--   datatype exported with all of its constructors.
HsEThingAll :: HsQName -> HsExportSpec

-- | T(C_1,...,C_n): A class exported with some of its methods, or
--   a datatype exported with some of its constructors.
HsEThingWith :: HsQName -> [HsCName] -> HsExportSpec

-- | module M: Re-export a module.
HsEModuleContents :: Module -> HsExportSpec

-- | Import declaration.
data HsImportDecl
HsImportDecl :: SrcLoc -> Module -> Bool -> Maybe Module -> Maybe (Bool, [HsImportSpec]) -> HsImportDecl

-- | Position of the import keyword.
[importLoc] :: HsImportDecl -> SrcLoc

-- | Name of the module imported.
[importModule] :: HsImportDecl -> Module

-- | Imported qualified?
[importQualified] :: HsImportDecl -> Bool

-- | Optional alias name in an as clause.
[importAs] :: HsImportDecl -> Maybe Module

-- | Optional list of import specifications. The Bool is True
--   if the names are excluded by hiding.
[importSpecs] :: HsImportDecl -> Maybe (Bool, [HsImportSpec])

-- | Import specification.
data HsImportSpec

-- | Variable.
HsIVar :: HsName -> HsImportSpec

-- | T: The name of a class, datatype or type synonym.
HsIAbs :: HsName -> HsImportSpec

-- | T(..): A class imported with all of its methods, or a
--   datatype imported with all of its constructors.
HsIThingAll :: HsName -> HsImportSpec

-- | T(C_1,...,C_n): A class imported with some of its methods, or
--   a datatype imported with some of its constructors.
HsIThingWith :: HsName -> [HsCName] -> HsImportSpec

-- | Associativity of an operator.
data HsAssoc

-- | Non-associative operator (declared with infix).
HsAssocNone :: HsAssoc

-- | Left-associative operator (declared with infixl).
HsAssocLeft :: HsAssoc

-- | Right-associative operator (declared with infixr).
HsAssocRight :: HsAssoc
data HsDecl
HsTypeDecl :: SrcLoc -> HsName -> [HsName] -> HsType -> HsDecl
HsDataDecl :: SrcLoc -> HsContext -> HsName -> [HsName] -> [HsConDecl] -> [HsQName] -> HsDecl
HsInfixDecl :: SrcLoc -> HsAssoc -> Int -> [HsOp] -> HsDecl
HsNewTypeDecl :: SrcLoc -> HsContext -> HsName -> [HsName] -> HsConDecl -> [HsQName] -> HsDecl
HsClassDecl :: SrcLoc -> HsContext -> HsName -> [HsName] -> [HsDecl] -> HsDecl
HsInstDecl :: SrcLoc -> HsContext -> HsQName -> [HsType] -> [HsDecl] -> HsDecl
HsDefaultDecl :: SrcLoc -> [HsType] -> HsDecl
HsTypeSig :: SrcLoc -> [HsName] -> HsQualType -> HsDecl
HsFunBind :: [HsMatch] -> HsDecl
HsPatBind :: SrcLoc -> HsPat -> HsRhs -> [HsDecl] -> HsDecl
HsForeignImport :: SrcLoc -> String -> HsSafety -> String -> HsName -> HsType -> HsDecl
HsForeignExport :: SrcLoc -> String -> String -> HsName -> HsType -> HsDecl

-- | Declaration of a data constructor.
data HsConDecl

-- | Ordinary data constructor.
HsConDecl :: SrcLoc -> HsName -> [HsBangType] -> HsConDecl

-- | Record constructor.
HsRecDecl :: SrcLoc -> HsName -> [([HsName], HsBangType)] -> HsConDecl

-- | The type of a constructor argument or field, optionally including a
--   strictness annotation.
data HsBangType

-- | Strict component, marked with "!".
HsBangedTy :: HsType -> HsBangType

-- | Non-strict component.
HsUnBangedTy :: HsType -> HsBangType

-- | Clauses of a function binding.
data HsMatch
HsMatch :: SrcLoc -> HsName -> [HsPat] -> HsRhs -> [HsDecl] -> HsMatch

-- | The right hand side of a function or pattern binding.
data HsRhs

-- | Unguarded right hand side (exp).
HsUnGuardedRhs :: HsExp -> HsRhs

-- | Guarded right hand side (gdrhs).
HsGuardedRhss :: [HsGuardedRhs] -> HsRhs

-- | A guarded right hand side | exp = exp.
--   The first expression will be Boolean-valued.
data HsGuardedRhs
HsGuardedRhs :: SrcLoc -> HsExp -> HsExp -> HsGuardedRhs

-- | Safety level for invoking a foreign entity.
data HsSafety

-- | Call may generate callbacks.
HsSafe :: HsSafety

-- | Call will not generate callbacks.
HsUnsafe :: HsSafety

-- | A type qualified with a context. An unqualified type has an empty
--   context.
data HsQualType
HsQualType :: HsContext -> HsType -> HsQualType
type HsContext = [HsAsst]

-- | Class assertions. In Haskell 98, the argument would be a tyvar,
--   but this definition allows multiple parameters, and allows them to be
--   types.
type HsAsst = (HsQName, [HsType])

-- | Haskell types and type constructors.
data HsType

-- | Function type.
HsTyFun :: HsType -> HsType -> HsType

-- | Tuple type.
HsTyTuple :: [HsType] -> HsType

-- | Application of a type constructor.
HsTyApp :: HsType -> HsType -> HsType

-- | Type variable.
HsTyVar :: HsName -> HsType

-- | Named type or type constructor.
HsTyCon :: HsQName -> HsType

-- | Haskell expressions.
--   
--   Notes:
--   
--   
--   
- Because it is difficult for parsers to distinguish patterns from
--   expressions, they typically parse them in the same way and then check
--   that they have the appropriate form. Hence the expression type
--   includes some forms that are found only in patterns. After these
--   checks, these constructors should not be used.
--   
- The parser does not take precedence and associativity into
--   account, so it will leave HsInfixApps associated to the
--   left.
--   
- The Pretty instance for HsExp does not add
--   parentheses in printing.
--   
data HsExp

-- | Variable.
HsVar :: HsQName -> HsExp

-- | Data constructor.
HsCon :: HsQName -> HsExp

-- | Literal constant.
HsLit :: HsLiteral -> HsExp

-- | Infix application.
HsInfixApp :: HsExp -> HsQOp -> HsExp -> HsExp

-- | Ordinary application.
HsApp :: HsExp -> HsExp -> HsExp

-- | Negation expression - exp.
HsNegApp :: HsExp -> HsExp

-- | Lambda expression.
HsLambda :: SrcLoc -> [HsPat] -> HsExp -> HsExp

-- | Local declarations with let.
HsLet :: [HsDecl] -> HsExp -> HsExp

-- | If exp then exp else
--   exp.
HsIf :: HsExp -> HsExp -> HsExp -> HsExp

-- | Case exp of alts.
HsCase :: HsExp -> [HsAlt] -> HsExp

-- | Do-expression: The last statement in the list should be an
--   expression.
HsDo :: [HsStmt] -> HsExp

-- | Tuple expression.
HsTuple :: [HsExp] -> HsExp

-- | List expression.
HsList :: [HsExp] -> HsExp

-- | Parenthesized expression.
HsParen :: HsExp -> HsExp

-- | Left section (exp qop).
HsLeftSection :: HsExp -> HsQOp -> HsExp

-- | Right section (qop exp).
HsRightSection :: HsQOp -> HsExp -> HsExp

-- | Record construction expression.
HsRecConstr :: HsQName -> [HsFieldUpdate] -> HsExp

-- | Record update expression.
HsRecUpdate :: HsExp -> [HsFieldUpdate] -> HsExp

-- | Unbounded arithmetic sequence, incrementing by 1.
HsEnumFrom :: HsExp -> HsExp

-- | Bounded arithmetic sequence, incrementing by 1.
HsEnumFromTo :: HsExp -> HsExp -> HsExp

-- | Unbounded arithmetic sequence, with first two elements given.
HsEnumFromThen :: HsExp -> HsExp -> HsExp

-- | Bounded arithmetic sequence, with first two elements given.
HsEnumFromThenTo :: HsExp -> HsExp -> HsExp -> HsExp

-- | List comprehension.
HsListComp :: HsExp -> [HsStmt] -> HsExp

-- | Expression type signature.
HsExpTypeSig :: SrcLoc -> HsExp -> HsQualType -> HsExp

-- | (patterns only)
HsAsPat :: HsName -> HsExp -> HsExp

-- | (patterns only)
HsWildCard :: HsExp

-- | (patterns only)
HsIrrPat :: HsExp -> HsExp

-- | This type represents both stmt in a do-expression, and
--   qual in a list comprehension.
data HsStmt

-- | A generator pat <- exp.
HsGenerator :: SrcLoc -> HsPat -> HsExp -> HsStmt

-- | An exp by itself: in a do-expression, an action whose
--   result is discarded; in a list comprehension, a guard expression.
HsQualifier :: HsExp -> HsStmt

-- | Local bindings.
HsLetStmt :: [HsDecl] -> HsStmt

-- | An fbind in a labeled record construction or update expression.
data HsFieldUpdate
HsFieldUpdate :: HsQName -> HsExp -> HsFieldUpdate

-- | An alt in a case expression.
data HsAlt
HsAlt :: SrcLoc -> HsPat -> HsGuardedAlts -> [HsDecl] -> HsAlt
data HsGuardedAlts

-- | -> exp.
HsUnGuardedAlt :: HsExp -> HsGuardedAlts

-- | gdpat.
HsGuardedAlts :: [HsGuardedAlt] -> HsGuardedAlts

-- | A guarded alternative | exp -> exp.
--   The first expression will be Boolean-valued.
data HsGuardedAlt
HsGuardedAlt :: SrcLoc -> HsExp -> HsExp -> HsGuardedAlt

-- | A pattern, to be matched against a value.
data HsPat

-- | Variable.
HsPVar :: HsName -> HsPat

-- | Literal constant.
HsPLit :: HsLiteral -> HsPat

-- | Negated pattern.
HsPNeg :: HsPat -> HsPat

-- | Pattern with infix data constructor.
HsPInfixApp :: HsPat -> HsQName -> HsPat -> HsPat

-- | Data constructor and argument patterns.
HsPApp :: HsQName -> [HsPat] -> HsPat

-- | Tuple pattern.
HsPTuple :: [HsPat] -> HsPat

-- | List pattern.
HsPList :: [HsPat] -> HsPat

-- | Parenthesized pattern.
HsPParen :: HsPat -> HsPat

-- | Labelled pattern.
HsPRec :: HsQName -> [HsPatField] -> HsPat

-- | @-Pattern.
HsPAsPat :: HsName -> HsPat -> HsPat

-- | Wildcard pattern (_).
HsPWildCard :: HsPat

-- | Irrefutable pattern (~).
HsPIrrPat :: HsPat -> HsPat

-- | An fpat in a labeled record pattern.
data HsPatField
HsPFieldPat :: HsQName -> HsPat -> HsPatField

-- | literal. Values of this type hold the abstract value of the
--   literal, not the precise string representation used. For example,
--   10, 0o12 and 0xa have the same
--   representation.
data HsLiteral

-- | Character literal.
HsChar :: Char -> HsLiteral

-- | String literal.
HsString :: String -> HsLiteral

-- | Integer literal.
HsInt :: Integer -> HsLiteral

-- | Floating point literal.
HsFrac :: Rational -> HsLiteral

-- | GHC unboxed character literal.
HsCharPrim :: Char -> HsLiteral

-- | GHC unboxed string literal.
HsStringPrim :: String -> HsLiteral

-- | GHC unboxed integer literal.
HsIntPrim :: Integer -> HsLiteral

-- | GHC unboxed float literal.
HsFloatPrim :: Rational -> HsLiteral

-- | GHC unboxed double literal.
HsDoublePrim :: Rational -> HsLiteral

-- | The name of a Haskell module.
newtype Module
Module :: String -> Module

-- | This type is used to represent qualified variables, and also qualified
--   constructors.
data HsQName

-- | Name qualified with a module name.
Qual :: Module -> HsName -> HsQName

-- | Unqualified name.
UnQual :: HsName -> HsQName

-- | Built-in constructor with special syntax.
Special :: HsSpecialCon -> HsQName

-- | This type is used to represent variables, and also constructors.
data HsName

-- | varid or conid.
HsIdent :: String -> HsName

-- | varsym or consym.
HsSymbol :: String -> HsName

-- | Possibly qualified infix operators (qop), appearing in
--   expressions.
data HsQOp

-- | Variable operator (qvarop).
HsQVarOp :: HsQName -> HsQOp

-- | Constructor operator (qconop).
HsQConOp :: HsQName -> HsQOp

-- | Operators, appearing in infix declarations.
data HsOp

-- | Variable operator (varop).
HsVarOp :: HsName -> HsOp

-- | Constructor operator (conop).
HsConOp :: HsName -> HsOp

-- | Constructors with special syntax. These names are never qualified, and
--   always refer to builtin type or data constructors.
data HsSpecialCon

-- | Unit type and data constructor ().
HsUnitCon :: HsSpecialCon

-- | List type constructor [].
HsListCon :: HsSpecialCon

-- | Function type constructor ->.
HsFunCon :: HsSpecialCon

-- | n-ary tuple type and data constructors (,) etc.
HsTupleCon :: Int -> HsSpecialCon

-- | List data constructor (:).
HsCons :: HsSpecialCon

-- | A name (cname) of a component of a class or data type in an
--   import or export specification.
data HsCName

-- | Name of a method or field.
HsVarName :: HsName -> HsCName

-- | Name of a data constructor.
HsConName :: HsName -> HsCName
prelude_mod :: Module
main_mod :: Module
main_name :: HsName
unit_con_name :: HsQName
tuple_con_name :: Int -> HsQName
list_cons_name :: HsQName
unit_con :: HsExp
tuple_con :: Int -> HsExp
unit_tycon_name :: HsQName
fun_tycon_name :: HsQName
list_tycon_name :: HsQName
tuple_tycon_name :: Int -> HsQName
unit_tycon :: HsType
fun_tycon :: HsType
list_tycon :: HsType
tuple_tycon :: Int -> HsType

-- | A position in the source.
data SrcLoc
SrcLoc :: String -> Int -> Int -> SrcLoc
[srcFilename] :: SrcLoc -> String
[srcLine] :: SrcLoc -> Int
[srcColumn] :: SrcLoc -> Int
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsAlt
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsAssoc
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsBangType
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsCName
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsConDecl
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsDecl
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsExp
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsExportSpec
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsFieldUpdate
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsGuardedAlt
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsGuardedAlts
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsGuardedRhs
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsImportDecl
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsImportSpec
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsLiteral
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsMatch
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsModule
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsName
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsOp
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsPat
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsPatField
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsQName
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsQOp
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsQualType
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsRhs
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsSafety
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsSpecialCon
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsStmt
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.HsType
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.Module
instance GHC.Internal.Data.Data.Data Language.Haskell.Syntax.SrcLoc
instance GHC.Classes.Eq Language.Haskell.Syntax.HsAlt
instance GHC.Classes.Eq Language.Haskell.Syntax.HsAssoc
instance GHC.Classes.Eq Language.Haskell.Syntax.HsBangType
instance GHC.Classes.Eq Language.Haskell.Syntax.HsCName
instance GHC.Classes.Eq Language.Haskell.Syntax.HsConDecl
instance GHC.Classes.Eq Language.Haskell.Syntax.HsDecl
instance GHC.Classes.Eq Language.Haskell.Syntax.HsExp
instance GHC.Classes.Eq Language.Haskell.Syntax.HsExportSpec
instance GHC.Classes.Eq Language.Haskell.Syntax.HsFieldUpdate
instance GHC.Classes.Eq Language.Haskell.Syntax.HsGuardedAlt
instance GHC.Classes.Eq Language.Haskell.Syntax.HsGuardedAlts
instance GHC.Classes.Eq Language.Haskell.Syntax.HsGuardedRhs
instance GHC.Classes.Eq Language.Haskell.Syntax.HsImportDecl
instance GHC.Classes.Eq Language.Haskell.Syntax.HsImportSpec
instance GHC.Classes.Eq Language.Haskell.Syntax.HsLiteral
instance GHC.Classes.Eq Language.Haskell.Syntax.HsMatch
instance GHC.Classes.Eq Language.Haskell.Syntax.HsModule
instance GHC.Classes.Eq Language.Haskell.Syntax.HsName
instance GHC.Classes.Eq Language.Haskell.Syntax.HsOp
instance GHC.Classes.Eq Language.Haskell.Syntax.HsPat
instance GHC.Classes.Eq Language.Haskell.Syntax.HsPatField
instance GHC.Classes.Eq Language.Haskell.Syntax.HsQName
instance GHC.Classes.Eq Language.Haskell.Syntax.HsQOp
instance GHC.Classes.Eq Language.Haskell.Syntax.HsQualType
instance GHC.Classes.Eq Language.Haskell.Syntax.HsRhs
instance GHC.Classes.Eq Language.Haskell.Syntax.HsSafety
instance GHC.Classes.Eq Language.Haskell.Syntax.HsSpecialCon
instance GHC.Classes.Eq Language.Haskell.Syntax.HsStmt
instance GHC.Classes.Eq Language.Haskell.Syntax.HsType
instance GHC.Classes.Eq Language.Haskell.Syntax.Module
instance GHC.Classes.Eq Language.Haskell.Syntax.SrcLoc
instance GHC.Classes.Ord Language.Haskell.Syntax.HsCName
instance GHC.Classes.Ord Language.Haskell.Syntax.HsName
instance GHC.Classes.Ord Language.Haskell.Syntax.HsOp
instance GHC.Classes.Ord Language.Haskell.Syntax.HsQName
instance GHC.Classes.Ord Language.Haskell.Syntax.HsQOp
instance GHC.Classes.Ord Language.Haskell.Syntax.HsSafety
instance GHC.Classes.Ord Language.Haskell.Syntax.HsSpecialCon
instance GHC.Classes.Ord Language.Haskell.Syntax.Module
instance GHC.Classes.Ord Language.Haskell.Syntax.SrcLoc
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsAlt
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsAssoc
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsBangType
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsCName
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsConDecl
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsDecl
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsExp
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsExportSpec
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsFieldUpdate
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsGuardedAlt
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsGuardedAlts
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsGuardedRhs
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsImportDecl
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsImportSpec
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsLiteral
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsMatch
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsModule
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsName
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsOp
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsPat
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsPatField
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsQName
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsQOp
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsQualType
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsRhs
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsSafety
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsSpecialCon
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsStmt
instance GHC.Internal.Show.Show Language.Haskell.Syntax.HsType
instance GHC.Internal.Show.Show Language.Haskell.Syntax.Module
instance GHC.Internal.Show.Show Language.Haskell.Syntax.SrcLoc

-- | Pretty printer for Haskell.
module Language.Haskell.Pretty

-- | Things that can be pretty-printed, including all the syntactic objects
--   in Language.Haskell.Syntax.
class Pretty a

-- | pretty-print with a given style and mode.
prettyPrintStyleMode :: Pretty a => Style -> PPHsMode -> a -> String

-- | pretty-print with the default style and a given mode.
prettyPrintWithMode :: Pretty a => PPHsMode -> a -> String

-- | pretty-print with the default style and defaultMode.
prettyPrint :: Pretty a => a -> String

-- | A rendering style. Allows us to specify constraints to choose among
--   the many different rendering options.
data Style
Style :: Mode -> Int -> Float -> Style

-- | The rendering mode.
[mode] :: Style -> Mode

-- | Maximum length of a line, in characters.
[lineLength] :: Style -> Int

-- | Ratio of line length to ribbon length. A ribbon refers to the
--   characters on a line excluding indentation. So a
--   lineLength of 100, with a ribbonsPerLine of 2.0
--   would only allow up to 50 characters of ribbon to be displayed on a
--   line, while allowing it to be indented up to 50 characters.
[ribbonsPerLine] :: Style -> Float

-- | The default style (mode=PageMode, lineLength=100,
--   ribbonsPerLine=1.5).
style :: Style

-- | Rendering mode.
data Mode

-- | Normal rendering (lineLength and ribbonsPerLine
--   respected').
PageMode :: Mode

-- | With zig-zag cuts.
ZigZagMode :: Mode

-- | No indentation, infinitely long lines (lineLength ignored), but
--   explicit new lines, i.e., text "one" $$ text "two", are
--   respected.
LeftMode :: Mode

-- | All on one line, lineLength ignored and explicit new lines
--   ($$) are turned into spaces.
OneLineMode :: Mode

-- | Pretty-printing parameters.
--   
--   Note: the onsideIndent must be positive and less than
--   all other indents.
data PPHsMode
PPHsMode :: Indent -> Indent -> Indent -> Indent -> Indent -> Indent -> Bool -> PPLayout -> Bool -> Bool -> PPHsMode

-- | Indentation of a class or instance.
[classIndent] :: PPHsMode -> Indent

-- | Indentation of a do-expression.
[doIndent] :: PPHsMode -> Indent

-- | Indentation of the body of a case expression.
[caseIndent] :: PPHsMode -> Indent

-- | Indentation of the declarations in a let expression.
[letIndent] :: PPHsMode -> Indent

-- | Indentation of the declarations in a where clause.
[whereIndent] :: PPHsMode -> Indent

-- | Indentation added for continuation lines that would otherwise be
--   offside.
[onsideIndent] :: PPHsMode -> Indent

-- | Blank lines between statements?
[spacing] :: PPHsMode -> Bool

-- | Pretty-printing style to use.
[layout] :: PPHsMode -> PPLayout

-- | Add GHC-style LINE pragmas to output?
[linePragmas] :: PPHsMode -> Bool

-- | (not implemented yet)
[comments] :: PPHsMode -> Bool
type Indent = Int

-- | Varieties of layout we can use.
data PPLayout

-- | Classical layout.
PPOffsideRule :: PPLayout

-- | Classical layout made explicit.
PPSemiColon :: PPLayout

-- | Inline decls, with newlines between them.
PPInLine :: PPLayout

-- | Everything on a single line.
PPNoLayout :: PPLayout

-- | The default mode: pretty-print using the offside rule and sensible
--   defaults.
defaultMode :: PPHsMode
instance GHC.Internal.Base.Applicative (Language.Haskell.Pretty.DocM s)
instance GHC.Classes.Eq Language.Haskell.Pretty.PPLayout
instance GHC.Internal.Base.Functor (Language.Haskell.Pretty.DocM s)
instance GHC.Internal.Base.Monad (Language.Haskell.Pretty.DocM s)
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsAlt
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsAssoc
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsBangType
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsCName
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsConDecl
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsDecl
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsExp
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsExportSpec
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsFieldUpdate
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsGuardedAlt
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsGuardedAlts
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsGuardedRhs
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsImportDecl
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsImportSpec
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsLiteral
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsMatch
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsModule
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsName
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsOp
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsPat
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsPatField
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsQName
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsQOp
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsQualType
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsRhs
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsSafety
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsStmt
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.HsType
instance Language.Haskell.Pretty.Pretty Language.Haskell.Syntax.Module

-- | Monads for the Haskell parser and lexer.
module Language.Haskell.ParseMonad

-- | Monad for parsing
data P a

-- | The result of a parse.
data ParseResult a

-- | The parse succeeded, yielding a value.
ParseOk :: a -> ParseResult a

-- | The parse failed at the specified source location, with an error
--   message.
ParseFailed :: SrcLoc -> String -> ParseResult a
atSrcLoc :: P a -> SrcLoc -> P a
data LexContext
NoLayout :: LexContext
Layout :: Int -> LexContext

-- | Static parameters governing a parse. More to come later, e.g. literate
--   mode, language extensions.
data ParseMode
ParseMode :: String -> ParseMode

-- | original name of the file being parsed
[parseFilename] :: ParseMode -> String

-- | Default parameters for a parse, currently just a marker for an unknown
--   filename.
defaultParseMode :: ParseMode
runParserWithMode :: ParseMode -> P a -> String -> ParseResult a
runParser :: P a -> String -> ParseResult a
getSrcLoc :: P SrcLoc
pushCurrentContext :: P ()
popContext :: P ()
data Lex r a
getInput :: Lex r String

-- | Discard some input characters (these must not include tabs or
--   newlines).
discard :: Int -> Lex r ()

-- | Discard the next character, which must be a newline.
lexNewline :: Lex a ()

-- | Discard the next character, which must be a tab.
lexTab :: Lex a ()
lexWhile :: (Char -> Bool) -> Lex a String
alternative :: Lex a v -> Lex a (Lex a v)
checkBOL :: Lex a Bool
setBOL :: Lex a ()
startToken :: Lex a ()
getOffside :: Lex a Ordering
pushContextL :: LexContext -> Lex a ()
popContextL :: String -> Lex a ()
instance GHC.Internal.Base.Applicative (Language.Haskell.ParseMonad.Lex r)
instance GHC.Internal.Base.Applicative Language.Haskell.ParseMonad.P
instance GHC.Internal.Base.Applicative Language.Haskell.ParseMonad.ParseResult
instance GHC.Classes.Eq Language.Haskell.ParseMonad.LexContext
instance GHC.Internal.Base.Functor (Language.Haskell.ParseMonad.Lex r)
instance GHC.Internal.Base.Functor Language.Haskell.ParseMonad.P
instance GHC.Internal.Base.Functor Language.Haskell.ParseMonad.ParseResult
instance GHC.Internal.Control.Monad.Fail.MonadFail (Language.Haskell.ParseMonad.Lex r)
instance GHC.Internal.Control.Monad.Fail.MonadFail Language.Haskell.ParseMonad.P
instance GHC.Internal.Base.Monad (Language.Haskell.ParseMonad.Lex r)
instance GHC.Internal.Base.Monad Language.Haskell.ParseMonad.P
instance GHC.Internal.Base.Monad Language.Haskell.ParseMonad.ParseResult
instance GHC.Internal.Base.Monoid m => GHC.Internal.Base.Monoid (Language.Haskell.ParseMonad.ParseResult m)
instance GHC.Classes.Ord Language.Haskell.ParseMonad.LexContext
instance GHC.Internal.Base.Monoid m => GHC.Internal.Base.Semigroup (Language.Haskell.ParseMonad.ParseResult m)
instance GHC.Internal.Show.Show Language.Haskell.ParseMonad.LexContext
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Language.Haskell.ParseMonad.ParseResult a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Language.Haskell.ParseMonad.ParseStatus a)

-- | Utilities for the Haskell parser.
module Language.Haskell.ParseUtils
splitTyConApp :: HsType -> P (HsName, [HsType])
mkRecConstrOrUpdate :: HsExp -> [HsFieldUpdate] -> P HsExp
checkPrec :: Integer -> P Int
checkContext :: HsType -> P HsContext
checkAssertion :: HsType -> P HsAsst
checkDataHeader :: HsQualType -> P (HsContext, HsName, [HsName])
checkClassHeader :: HsQualType -> P (HsContext, HsName, [HsName])
checkInstHeader :: HsQualType -> P (HsContext, HsQName, [HsType])
checkPattern :: HsExp -> P HsPat
checkExpr :: HsExp -> P HsExp
checkValDef :: SrcLoc -> HsExp -> HsRhs -> [HsDecl] -> P HsDecl
checkClassBody :: [HsDecl] -> P [HsDecl]
checkUnQual :: HsQName -> P HsName
checkRevDecls :: [HsDecl] -> P [HsDecl]

-- | Lexer for Haskell.
module Language.Haskell.Lexer
data Token
VarId :: String -> Token
QVarId :: (String, String) -> Token
ConId :: String -> Token
QConId :: (String, String) -> Token
VarSym :: String -> Token
ConSym :: String -> Token
QVarSym :: (String, String) -> Token
QConSym :: (String, String) -> Token
IntTok :: Integer -> Token
FloatTok :: Rational -> Token
Character :: Char -> Token
StringTok :: String -> Token
LeftParen :: Token
RightParen :: Token
SemiColon :: Token
LeftCurly :: Token
RightCurly :: Token
VRightCurly :: Token
LeftSquare :: Token
RightSquare :: Token
Comma :: Token
Underscore :: Token
BackQuote :: Token
DotDot :: Token
Colon :: Token
DoubleColon :: Token
Equals :: Token
Backslash :: Token
Bar :: Token
LeftArrow :: Token
RightArrow :: Token
At :: Token
Tilde :: Token
DoubleArrow :: Token
Minus :: Token
Exclamation :: Token
KW_Case :: Token
KW_Class :: Token
KW_Data :: Token
KW_Default :: Token
KW_Deriving :: Token
KW_Do :: Token
KW_Else :: Token
KW_Foreign :: Token
KW_If :: Token
KW_Import :: Token
KW_In :: Token
KW_Infix :: Token
KW_InfixL :: Token
KW_InfixR :: Token
KW_Instance :: Token
KW_Let :: Token
KW_Module :: Token
KW_NewType :: Token
KW_Of :: Token
KW_Then :: Token
KW_Type :: Token
KW_Where :: Token
KW_As :: Token
KW_Export :: Token
KW_Hiding :: Token
KW_Qualified :: Token
KW_Safe :: Token
KW_Unsafe :: Token
EOF :: Token
lexer :: (Token -> P a) -> P a
instance GHC.Classes.Eq Language.Haskell.Lexer.Token
instance GHC.Internal.Show.Show Language.Haskell.Lexer.Token

-- | Haskell parser.
module Language.Haskell.Parser

-- | Parse of a string, which should contain a complete Haskell 98 module.
parseModule :: String -> ParseResult HsModule

-- | Parse of a string, which should contain a complete Haskell 98 module.
parseModuleWithMode :: ParseMode -> String -> ParseResult HsModule

-- | Static parameters governing a parse. More to come later, e.g. literate
--   mode, language extensions.
data ParseMode
ParseMode :: String -> ParseMode

-- | original name of the file being parsed
[parseFilename] :: ParseMode -> String

-- | Default parameters for a parse, currently just a marker for an unknown
--   filename.
defaultParseMode :: ParseMode

-- | The result of a parse.
data ParseResult a

-- | The parse succeeded, yielding a value.
ParseOk :: a -> ParseResult a

-- | The parse failed at the specified source location, with an error
--   message.
ParseFailed :: SrcLoc -> String -> ParseResult a
