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

-- | A program and library to derive instances for data types
--   
--   Data.Derive is a library and a tool for deriving instances for Haskell
--   programs. It is designed to work with custom derivations, SYB and
--   Template Haskell mechanisms. The tool requires GHC, but the generated
--   code is portable to all compilers. We see this tool as a competitor to
--   DrIFT.
@package derive
@version 2.6.5

module Data.Derive.Class.Arities
class Arities a
arities :: Arities a => a -> [Int]

module Data.Derive.Class.Default
class Default a
def :: Default a => a

module Data.Derive.Instance.Arities
instance Data.Data.Data d_type => Data.Derive.Class.Arities.Arities d_type

module Language.Haskell
type FullDataDecl = (ModuleName (), DataDecl)
type FieldDecl = [(String, Type ())]
type CtorDecl = Either (QualConDecl ()) (GadtDecl ())
type DataDecl = Decl ()
(?) :: () => Bool -> a -> a -> a
infix 1 ?
foralls :: Type () -> Type ()
tyApps :: Type () -> [Type ()] -> Type ()
fromTyApps :: Type () -> (Type (), [Type ()])
fromTyTuple :: () => Type l -> [Type l]
fromTyParen :: Type () -> Type ()
fromTyParens :: Type () -> Type ()
tyRoot :: Type () -> String
isTyFun :: Type () -> Bool
isTyParen :: () => Type l -> Bool
fromTyList :: () => Type l -> Maybe (Type l)
(~=) :: Pretty a => a -> String -> Bool
appP :: Exp () -> Exp () -> Exp ()
simplify :: Data a => a -> a
isGuardFalse :: () => Match l -> Bool
rename :: QName () -> QName ()
isAtom :: () => Exp l -> Bool
paren :: Exp () -> Exp ()
sl :: SrcLoc
noSl :: Data from => from -> from
isIdent :: [Char] -> Bool
title :: [Char] -> [Char]
qname :: String -> QName ()
var :: String -> Exp ()
con :: String -> Exp ()
tyVar :: String -> Type ()
tyVarBind :: String -> TyVarBind ()
tyCon :: String -> Type ()
pVar :: String -> Pat ()
qvop :: String -> QOp ()
dataDeclType :: DataDecl -> Type ()
dataDeclFields :: DataDecl -> [String]
moduleName :: () => Module l -> ModuleName l
moduleDecls :: () => Module l -> [Decl l]
moduleImports :: () => Module l -> [ImportDecl l]
modulePragmas :: () => Module l -> [ModulePragma l]
showDecls :: Pretty a => [a] -> String
tyApp :: Type () -> [Type ()] -> Type ()
tyFun :: [Type ()] -> Type ()
apps :: Exp () -> [Exp ()] -> Exp ()
bind :: String -> [Pat ()] -> Exp () -> Decl ()
binds :: String -> [([Pat ()], Exp ())] -> Decl ()
isDataDecl :: Decl () -> Bool
dataDeclName :: DataDecl -> String
fromDeclHead :: DeclHead a -> (Name a, [TyVarBind a])
fromIParen :: InstRule a -> InstRule a
fromInstHead :: InstHead a -> (QName a, [Type a])
dataDeclVars :: DataDecl -> [String]
dataDeclVarsStar :: DataDecl -> [String]
dataDeclArity :: DataDecl -> Int
dataDeclCtors :: DataDecl -> [CtorDecl]
ctorDeclName :: CtorDecl -> String
ctorDeclName' :: CtorDecl -> Name ()
ctorDeclFields :: CtorDecl -> FieldDecl
ctorDeclArity :: CtorDecl -> Int
declName :: Decl () -> String

-- | Gather the extensions declared in LANGUAGE pragmas at the top of the
--   file. Returns Nothing if the parse of the pragmas fails.
readExtensions :: String -> Maybe (Maybe Language, [Extension])
parseFileContentsWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])

-- | Parse a source file from a string using a custom parse mode.
parseFileContentsWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)

-- | Parse a source file from a string, with an extra set of extensions to
--   know about on top of what the file itself declares.
parseFileContentsWithExts :: [Extension] -> String -> ParseResult (Module SrcSpanInfo)

-- | Parse a source file from a string using the default parse mode.
parseFileContents :: String -> ParseResult (Module SrcSpanInfo)

-- | Parse a source file on disk, supplying a custom parse mode, and
--   retaining comments as well as unknown pragmas.
parseFileWithCommentsAndPragmas :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo, [Comment], [UnknownPragma]))
parseFileWithComments :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo, [Comment]))

-- | Parse a source file on disk, supplying a custom parse mode.
parseFileWithMode :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo))

-- | Parse a source file on disk, with an extra set of extensions to know
--   about on top of what the file itself declares.
parseFileWithExts :: [Extension] -> FilePath -> IO (ParseResult (Module SrcSpanInfo))

-- | Parse a source file on disk, using the default parse mode.
parseFile :: FilePath -> IO (ParseResult (Module SrcSpanInfo))

-- | Apply a constructor of a given name to a list of pattern arguments,
--   forming a constructor pattern.
metaConPat :: String -> [Pat ()] -> Pat ()

-- | Apply function of a given name to a list of arguments.
metaFunction :: String -> [Exp ()] -> Exp ()

-- | Bind an identifier to an expression.
nameBind :: Name () -> Exp () -> Decl ()

-- | A pattern bind where the pattern is a variable, and where there are no
--   guards, but with a 'where' clause.
patBindWhere :: Pat () -> Exp () -> [Decl ()] -> Decl ()

-- | A pattern bind where the pattern is a variable, and where there are no
--   guards and no 'where' clause.
patBind :: Pat () -> Exp () -> Decl ()

-- | A function with a single clause, a single argument, no guards and no
--   where declarations
simpleFun :: Name () -> Name () -> Exp () -> Decl ()

-- | A function with a single clause
sfun :: Name () -> [Name ()] -> Rhs () -> Maybe (Binds ()) -> Decl ()

-- | Generate k names by appending numbers 1 through k to a given string.
genNames :: String -> Int -> [Name ()]

-- | The wildcard pattern: _
wildcard :: Pat ()

-- | An empty binding group.
noBinds :: Maybe (Binds ())

-- | A let binding group as a statement.
letStmt :: [Decl ()] -> Stmt ()

-- | A generator statement: pat <- exp
genStmt :: Pat () -> Exp () -> Stmt ()

-- | A qualifier expression statement.
qualStmt :: Exp () -> Stmt ()

-- | Put parentheses around a pattern.
pParen :: Pat () -> Pat ()

-- | The empty list pattern.
peList :: Pat ()

-- | The empty list expression.
eList :: Exp ()

-- | A list expression.
listE :: [Exp ()] -> Exp ()

-- | An alternative with a single guard in a case expression.
altGW :: Pat () -> [Stmt ()] -> Exp () -> Binds () -> Alt ()

-- | An unguarded alternative in a case expression.
alt :: Pat () -> Exp () -> Alt ()

-- | A case expression.
caseE :: Exp () -> [Alt ()] -> Exp ()

-- | A let ... in block.
letE :: [Decl ()] -> Exp () -> Exp ()

-- | Lambda abstraction, given a list of argument patterns and an
--   expression body.
lamE :: [Pat ()] -> Exp () -> Exp ()

-- | A do block formed by the given statements. The last statement in the
--   list should be a Qualifier expression.
doE :: [Stmt ()] -> Exp ()

-- | A literal integer pattern.
intP :: Integer -> Pat ()

-- | A literal character pattern.
charP :: Char -> Pat ()

-- | A literal string pattern.
strP :: String -> Pat ()

-- | A literal integer expression.
intE :: Integer -> Exp ()

-- | A literal character expression.
charE :: Char -> Exp ()

-- | A literal string expression.
strE :: String -> Exp ()

-- | A function with a given name.
function :: String -> Exp ()

-- | A tuple pattern consisting of variables only.
pvarTuple :: [Name ()] -> Pat ()

-- | A tuple expression consisting of variables only.
varTuple :: [Name ()] -> Exp ()

-- | A tuple pattern.
pTuple :: [Pat ()] -> Pat ()

-- | A tuple expression.
tuple :: [Exp ()] -> Exp ()

-- | A constructor pattern, with argument patterns.
pApp :: Name () -> [Pat ()] -> Pat ()

-- | Apply a function to a list of arguments.
appFun :: Exp () -> [Exp ()] -> Exp ()

-- | Apply an operator infix.
infixApp :: Exp () -> QOp () -> Exp () -> Exp ()

-- | A pattern variable.
pvar :: Name () -> Pat ()

-- | A qualified variable as expression.
qvar :: ModuleName () -> Name () -> Exp ()

-- | Use the given identifier as an operator.
op :: Name () -> QOp ()

-- | A symbol identifier. The string should be a valid Haskell symbol
--   identifier.
sym :: String -> Name ()

-- | An identifier with the given string as its name. The string should be
--   a valid Haskell identifier.
name :: String -> Name ()

-- | Print an AST exactly as specified by the annotations on the nodes in
--   the tree.
exactPrint :: ExactP ast => ast SrcSpanInfo -> [Comment] -> String
class Annotated ast => ExactP (ast :: Type -> Type)
unListOf :: () => ListOf a -> [a]

-- | Non-greedy parse of a string starting with a series of top-level
--   option pragmas.
getTopPragmas :: String -> ParseResult [ModulePragma SrcSpanInfo]

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseImportDeclWithComments :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell type, using an explicit
--   ParseMode.
parseImportDeclWithMode :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo)

-- | Parse of a string containing a Haskell statement, using
--   defaultParseMode.
parseImportDecl :: String -> ParseResult (ImportDecl SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseStmtWithComments :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell type, using an explicit
--   ParseMode.
parseStmtWithMode :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)

-- | Parse of a string containing a Haskell statement, using
--   defaultParseMode.
parseStmt :: String -> ParseResult (Stmt SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseTypeWithComments :: ParseMode -> String -> ParseResult (Type SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell type, using an explicit
--   ParseMode.
parseTypeWithMode :: ParseMode -> String -> ParseResult (Type SrcSpanInfo)

-- | Parse of a string containing a Haskell type, using
--   defaultParseMode.
parseType :: String -> ParseResult (Type SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseDeclWithComments :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell top-level declaration, using an
--   explicit ParseMode.
parseDeclWithMode :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo)

-- | Parse of a string containing a Haskell top-level declaration, using
--   defaultParseMode.
parseDecl :: String -> ParseResult (Decl SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parsePatWithComments :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell pattern, using an explicit
--   ParseMode.
parsePatWithMode :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo)

-- | Parse of a string containing a Haskell pattern, using
--   defaultParseMode.
parsePat :: String -> ParseResult (Pat SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseExpWithComments :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell expression, using an explicit
--   ParseMode.
parseExpWithMode :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo)

-- | Parse of a string containing a Haskell expression, using
--   defaultParseMode.
parseExp :: String -> ParseResult (Exp SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseModuleWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode.
parseModuleWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)

-- | Parse of a string, which should contain a complete Haskell module,
--   using defaultParseMode.
parseModule :: String -> ParseResult (Module SrcSpanInfo)

-- | Type intended to be used with Parseable, with instances that
--   implement a non-greedy parse of the module name, including top-level
--   pragmas. This means that a parse error that comes after the module
--   header won't be returned. If the Maybe value is Nothing,
--   then this means that there was no module header.
data PragmasAndModuleName l
PragmasAndModuleName :: l -> [ModulePragma l] -> Maybe (ModuleName l) -> PragmasAndModuleName l
data PragmasAndModuleHead l
PragmasAndModuleHead :: l -> [ModulePragma l] -> Maybe (ModuleHead l) -> PragmasAndModuleHead l
data ModuleHeadAndImports l
ModuleHeadAndImports :: l -> [ModulePragma l] -> Maybe (ModuleHead l) -> [ImportDecl l] -> ModuleHeadAndImports l

-- | Instances of Parseable for NonGreedy a will only
--   consume the input until a is fully parsed. This means that
--   parse errors that come later in the input will be ignored. It's also
--   more efficient, as it's fully lazy in the remainder of the input:
--   
--   
--   >>> parse (unlines ("module A where" : "main =" : repeat "blah")) :: ParseResult PragmasAndModuleHead
--   ParseOk (NonGreedy {unNonGreedy = PragmasAndModuleHead [] (ModuleName "A",Nothing,Nothing)})
--   
--   
--   (this example uses the simplified AST)
newtype NonGreedy a
NonGreedy :: a -> NonGreedy a
[unNonGreedy] :: NonGreedy a -> a

-- | ListOf a stores lists of the AST type a, along with
--   a SrcSpanInfo, in order to provide Parseable instances
--   for lists. These instances are provided when the type is used as a
--   list in the syntax, and the same delimiters are used in all of its
--   usages. Some exceptions are made:
data ListOf a
ListOf :: SrcSpanInfo -> [a] -> ListOf a

-- | Lex a string into a list of Haskell source tokens, using an explicit
--   mode.
lexTokenStreamWithMode :: ParseMode -> String -> ParseResult [Loc Token]

-- | Lex a string into a list of Haskell 2010 source tokens.
lexTokenStream :: String -> ParseResult [Loc Token]
data Token
VarId :: String -> Token
LabelVarId :: String -> Token
QVarId :: (String, String) -> Token
IDupVarId :: String -> Token
ILinVarId :: String -> Token
ConId :: String -> Token
QConId :: (String, String) -> Token
DVarId :: [String] -> Token
VarSym :: String -> Token
ConSym :: String -> Token
QVarSym :: (String, String) -> Token
QConSym :: (String, String) -> Token
IntTok :: (Integer, String) -> Token
FloatTok :: (Rational, String) -> Token
Character :: (Char, String) -> Token
StringTok :: (String, String) -> Token
IntTokHash :: (Integer, String) -> Token
WordTokHash :: (Integer, String) -> Token
FloatTokHash :: (Rational, String) -> Token
DoubleTokHash :: (Rational, String) -> Token
CharacterHash :: (Char, String) -> Token
StringHash :: (String, String) -> Token
LeftParen :: Token
RightParen :: Token
LeftHashParen :: Token
RightHashParen :: Token
SemiColon :: Token
LeftCurly :: Token
RightCurly :: Token
VRightCurly :: Token
LeftSquare :: Token
RightSquare :: Token
ParArrayLeftSquare :: Token
ParArrayRightSquare :: Token
Comma :: Token
Underscore :: Token
BackQuote :: Token
Dot :: Token
DotDot :: Token
Colon :: Token
QuoteColon :: Token
DoubleColon :: Token
Equals :: Token
Backslash :: Token
Bar :: Token
LeftArrow :: Token
RightArrow :: Token
At :: Token
TApp :: Token
Tilde :: Token
DoubleArrow :: Token
Minus :: Token
Exclamation :: Token
Star :: Token
LeftArrowTail :: Token
RightArrowTail :: Token
LeftDblArrowTail :: Token
RightDblArrowTail :: Token
THExpQuote :: Token
THPatQuote :: Token
THDecQuote :: Token
THTypQuote :: Token
THCloseQuote :: Token

-- | ]
THIdEscape :: String -> Token
THParenEscape :: Token
THVarQuote :: Token
THTyQuote :: Token
THQuasiQuote :: (String, String) -> Token
RPGuardOpen :: Token
RPGuardClose :: Token

-- | )
RPCAt :: Token
XCodeTagOpen :: Token
XCodeTagClose :: Token
XStdTagOpen :: Token
XStdTagClose :: Token
XCloseTagOpen :: Token
XEmptyTagClose :: Token
XChildTagOpen :: Token
XPCDATA :: String -> Token
XRPatOpen :: Token
XRPatClose :: Token
PragmaEnd :: Token
RULES :: Token
INLINE :: Bool -> Token
INLINE_CONLIKE :: Token
SPECIALISE :: Token
SPECIALISE_INLINE :: Bool -> Token
SOURCE :: Token
DEPRECATED :: Token
WARNING :: Token
SCC :: Token
GENERATED :: Token
CORE :: Token
UNPACK :: Token
NOUNPACK :: Token
OPTIONS :: (Maybe String, String) -> Token
LANGUAGE :: Token
ANN :: Token
MINIMAL :: Token
NO_OVERLAP :: Token
OVERLAP :: Token
OVERLAPPING :: Token
OVERLAPPABLE :: Token
OVERLAPS :: Token
INCOHERENT :: Token
COMPLETE :: Token
KW_As :: Token
KW_By :: Token
KW_Case :: Token
KW_Class :: Token
KW_Data :: Token
KW_Default :: Token
KW_Deriving :: Token
KW_Do :: Token
KW_MDo :: Token
KW_Else :: Token
KW_Family :: Token
KW_Forall :: Token
KW_Group :: Token
KW_Hiding :: 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_Proc :: Token
KW_Rec :: Token
KW_Role :: Token
KW_Then :: Token
KW_Type :: Token
KW_Using :: Token
KW_Where :: Token
KW_Qualified :: Token
KW_Pattern :: Token
KW_Stock :: Token
KW_Anyclass :: Token
KW_Foreign :: Token
KW_Export :: Token
KW_Safe :: Token
KW_Unsafe :: Token
KW_Threadsafe :: Token
KW_Interruptible :: Token
KW_StdCall :: Token
KW_CCall :: Token
KW_CPlusPlus :: Token
KW_DotNet :: Token
KW_Jvm :: Token
KW_Js :: Token
KW_JavaScript :: Token
KW_CApi :: Token
EOF :: Token

-- | Default parameters for a parse. The default is an unknown filename, no
--   extensions (i.e. Haskell 98), don't ignore LANGUAGE pragmas, do ignore
--   LINE pragmas, and be aware of fixities from the Prelude.
defaultParseMode :: ParseMode

-- | Retrieve the result of a successful parse, throwing an error if the
--   parse is actually not successful.
fromParseResult :: () => ParseResult a -> a

-- | Class providing function for parsing at many different types.
--   
--   Note that for convenience of implementation, the default methods have
--   definitions equivalent to undefined. The minimal definition is
--   all of the visible methods.
class Parseable ast

-- | Parse a string with default mode.
parse :: Parseable ast => String -> ParseResult ast

-- | Parse a string with an explicit ParseMode.
parseWithMode :: Parseable ast => ParseMode -> String -> ParseResult ast

-- | Parse a string with an explicit ParseMode, returning all
--   comments along with the AST.
parseWithComments :: Parseable ast => ParseMode -> String -> ParseResult (ast, [Comment])

-- | 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

-- | Static parameters governing a parse. Note that the various parse
--   functions in Language.Haskell.Exts.Parser never look at
--   LANGUAGE pragmas, regardless of what the
--   ignoreLanguagePragmas flag is set to. Only the various
--   parseFile functions in Language.Haskell.Exts will act
--   on it, when set to False.
data ParseMode
ParseMode :: String -> Language -> [Extension] -> Bool -> Bool -> Maybe [Fixity] -> Bool -> ParseMode

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

-- | base language (e.g. Haskell98, Haskell2010)
[baseLanguage] :: ParseMode -> Language

-- | list of extensions enabled for parsing
[extensions] :: ParseMode -> [Extension]

-- | if True, the parser won't care about further extensions in
--   LANGUAGE pragmas in source files
[ignoreLanguagePragmas] :: ParseMode -> Bool

-- | if True, the parser won't read line position information from
--   LINE pragmas in source files
[ignoreLinePragmas] :: ParseMode -> Bool

-- | list of fixities to be aware of
[fixities] :: ParseMode -> Maybe [Fixity]

-- | Checks whether functions have a consistent arity
[ignoreFunctionArity] :: ParseMode -> Bool

-- | Associates an AST with Source Span Information with relevant Haddock
--   comments
associateHaddock :: (Annotated ast, Traversable ast) => (ast SrcSpanInfo, [Comment]) -> ast (SrcSpanInfo, [Comment])

-- | A Haskell comment. The Bool is True if the comment is
--   multi-line, i.e. {- -}.
data Comment
Comment :: Bool -> SrcSpan -> String -> Comment

-- | An unknown pragma.
data UnknownPragma
UnknownPragma :: SrcSpan -> String -> UnknownPragma
infix_ :: Int -> [String] -> [Fixity]
infixl_ :: Int -> [String] -> [Fixity]
infixr_ :: Int -> [String] -> [Fixity]

-- | All fixities defined in the base package.
--   
--   Note that the +++ operator appears in both Control.Arrows and
--   Text.ParserCombinators.ReadP. The listed precedence for +++
--   in this list is that of Control.Arrows.
baseFixities :: [Fixity]

-- | All fixities defined in the Prelude.
preludeFixities :: [Fixity]

-- | Operator fixities are represented by their associativity (left, right
--   or none) and their precedence (0-9).
data Fixity
Fixity :: Assoc () -> Int -> QName () -> Fixity

-- | All AST elements that may include expressions which in turn may need
--   fixity tweaking will be instances of this class.
class AppFixity (ast :: Type -> Type)

-- | Tweak any expressions in the element to account for the fixities
--   given. Assumes that all operator expressions are fully left
--   associative chains to begin with.
applyFixities :: (AppFixity ast, Monad m) => [Fixity] -> ast SrcSpanInfo -> m (ast SrcSpanInfo)

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

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

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

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

-- | render the document with a given mode. renderWithMode :: PPHsMode
--   -> Doc -> String renderWithMode = renderStyleMode P.style
--   
--   render the document with defaultMode. render :: Doc ->
--   String render = renderWithMode defaultMode
--   
--   pretty-print with a given style and mode.
prettyPrintStyleMode :: Pretty a => Style -> PPHsMode -> a -> String

-- | The default mode: pretty-print using the offside rule and sensible
--   defaults.
defaultMode :: PPHsMode

-- | 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
type Indent = Int

-- | Pretty-printing parameters.
--   
--   Note: the onsideIndent must be positive and less than
--   all other indents.
data PPHsMode
PPHsMode :: Indent -> Indent -> Indent -> Indent -> Indent -> Indent -> Indent -> Bool -> PPLayout -> 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
[multiIfIndent] :: PPHsMode -> Indent

-- | indentation of the body of a multi-if 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

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

-- | Test if two AST elements are equal modulo annotations.
(=~=) :: (Annotated a, Eq (a ())) => a l1 -> a l2 -> Bool
tuple_tycon :: () => l -> Boxed -> Int -> Type l
unboxed_singleton_tycon :: () => l -> Type l
list_tycon :: () => l -> Type l
fun_tycon :: () => l -> Type l
unit_tycon :: () => l -> Type l
tuple_tycon_name :: () => l -> Boxed -> Int -> QName l
unboxed_singleton_tycon_name :: () => l -> QName l
list_tycon_name :: () => l -> QName l
fun_tycon_name :: () => l -> QName l
unit_tycon_name :: () => l -> QName l
anyclass_name :: () => l -> Name l
stock_name :: () => l -> Name l
role_name :: () => l -> Name l
family_name :: () => l -> Name l
forall_name :: () => l -> Name l
capi_name :: () => l -> Name l
javascript_name :: () => l -> Name l
js_name :: () => l -> Name l
jvm_name :: () => l -> Name l
dotnet_name :: () => l -> Name l
cplusplus_name :: () => l -> Name l
ccall_name :: () => l -> Name l
stdcall_name :: () => l -> Name l
threadsafe_name :: () => l -> Name l
interruptible_name :: () => l -> Name l
unsafe_name :: () => l -> Name l
safe_name :: () => l -> Name l
export_name :: () => l -> Name l
hole_name :: () => l -> QName l
star_name :: () => l -> Name l
dot_name :: () => l -> Name l
bang_name :: () => l -> Name l
minus_name :: () => l -> Name l
hiding_name :: () => l -> Name l
qualified_name :: () => l -> Name l
as_name :: () => l -> Name l
unboxed_singleton_con :: () => l -> Exp l
tuple_con :: () => l -> Boxed -> Int -> Exp l
unit_con :: () => l -> Exp l
unboxed_singleton_con_name :: () => l -> QName l
list_cons_name :: () => l -> QName l
tuple_con_name :: () => l -> Boxed -> Int -> QName l
unit_con_name :: () => l -> QName l
main_name :: () => l -> Name l
main_mod :: () => l -> ModuleName l
prelude_mod :: () => l -> ModuleName l

-- | The name of a Haskell module.
data ModuleName l
ModuleName :: l -> String -> ModuleName l

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

-- | unit type and data constructor ()
UnitCon :: l -> SpecialCon l

-- | list type constructor []
ListCon :: l -> SpecialCon l

-- | function type constructor ->
FunCon :: l -> SpecialCon l

-- | n-ary tuple type and data constructors (,) etc,
--   possibly boxed (#,#)
TupleCon :: l -> Boxed -> Int -> SpecialCon l

-- | list data constructor (:)
Cons :: l -> SpecialCon l

-- | unboxed singleton tuple constructor (# #)
UnboxedSingleCon :: l -> SpecialCon l

-- | An expression hole _
ExprHole :: l -> SpecialCon l

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

-- | name qualified with a module name
Qual :: l -> ModuleName l -> Name l -> QName l

-- | unqualified local name
UnQual :: l -> Name l -> QName l

-- | built-in constructor with special syntax
Special :: l -> SpecialCon l -> QName l

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

-- | varid or conid.
Ident :: l -> String -> Name l

-- | varsym or consym
Symbol :: l -> String -> Name l

-- | An implicit parameter name.
data IPName l

-- | ?ident, non-linear implicit parameter
IPDup :: l -> String -> IPName l

-- | %ident, linear implicit parameter
IPLin :: l -> String -> IPName l

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

-- | variable operator (qvarop)
QVarOp :: l -> QName l -> QOp l

-- | constructor operator (qconop)
QConOp :: l -> QName l -> QOp l

-- | Operators appearing in infix declarations are never
--   qualified.
data Op l

-- | variable operator (varop)
VarOp :: l -> Name l -> Op l

-- | constructor operator (conop)
ConOp :: l -> Name l -> Op l

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

-- | name of a method or field
VarName :: l -> Name l -> CName l

-- | name of a data constructor
ConName :: l -> Name l -> CName l

-- | A complete Haskell source module.
data Module l

-- | an ordinary Haskell module
Module :: l -> Maybe (ModuleHead l) -> [ModulePragma l] -> [ImportDecl l] -> [Decl l] -> Module l

-- | a module consisting of a single XML document. The ModuleName never
--   appears in the source but is needed for semantic purposes, it will be
--   the same as the file name.
XmlPage :: l -> ModuleName l -> [ModulePragma l] -> XName l -> [XAttr l] -> Maybe (Exp l) -> [Exp l] -> Module l

-- | a hybrid module combining an XML document with an ordinary module
XmlHybrid :: l -> Maybe (ModuleHead l) -> [ModulePragma l] -> [ImportDecl l] -> [Decl l] -> XName l -> [XAttr l] -> Maybe (Exp l) -> [Exp l] -> Module l

-- | The head of a module, including the name and export specification.
data ModuleHead l
ModuleHead :: l -> ModuleName l -> Maybe (WarningText l) -> Maybe (ExportSpecList l) -> ModuleHead l

-- | An explicit export specification.
data ExportSpecList l
ExportSpecList :: l -> [ExportSpec l] -> ExportSpecList l

-- | An item in a module's export specification.
data ExportSpec l

-- | variable.
EVar :: l -> QName l -> ExportSpec l

-- | T: a class or datatype exported abstractly, or a type
--   synonym.
EAbs :: l -> Namespace l -> QName l -> ExportSpec l

-- | T(C_1,...,C_n): a class exported with some of its methods, or
--   a datatype exported with some of its constructors.
EThingWith :: l -> EWildcard l -> QName l -> [CName l] -> ExportSpec l

-- | module M: re-export a module.
EModuleContents :: l -> ModuleName l -> ExportSpec l

-- | Indicates the position of the wildcard in an export list
data EWildcard l
NoWildcard :: l -> EWildcard l
EWildcard :: l -> Int -> EWildcard l

-- | Namespaces for imports/exports.
data Namespace l
NoNamespace :: l -> Namespace l
TypeNamespace :: l -> Namespace l
PatternNamespace :: l -> Namespace l

-- | An import declaration.
data ImportDecl l
ImportDecl :: l -> ModuleName l -> Bool -> Bool -> Bool -> Maybe String -> Maybe (ModuleName l) -> Maybe (ImportSpecList l) -> ImportDecl l

-- | annotation, used by parser for position of the import
--   keyword.
[importAnn] :: ImportDecl l -> l

-- | name of the module imported.
[importModule] :: ImportDecl l -> ModuleName l

-- | imported qualified?
[importQualified] :: ImportDecl l -> Bool

-- | imported with {-# SOURCE #-}?
[importSrc] :: ImportDecl l -> Bool

-- | Import safe?
[importSafe] :: ImportDecl l -> Bool

-- | imported with explicit package name
[importPkg] :: ImportDecl l -> Maybe String

-- | optional alias name in an as clause.
[importAs] :: ImportDecl l -> Maybe (ModuleName l)

-- | optional list of import specifications.
[importSpecs] :: ImportDecl l -> Maybe (ImportSpecList l)

-- | An explicit import specification list.
data ImportSpecList l
ImportSpecList :: l -> Bool -> [ImportSpec l] -> ImportSpecList l

-- | An import specification, representing a single explicit item imported
--   (or hidden) from a module.
data ImportSpec l

-- | variable
IVar :: l -> Name l -> ImportSpec l

-- | T: the name of a class, datatype or type synonym.
IAbs :: l -> Namespace l -> Name l -> ImportSpec l

-- | T(..): a class imported with all of its methods, or a
--   datatype imported with all of its constructors.
IThingAll :: l -> Name l -> ImportSpec l

-- | T(C_1,...,C_n): a class imported with some of its methods, or
--   a datatype imported with some of its constructors.
IThingWith :: l -> Name l -> [CName l] -> ImportSpec l

-- | Associativity of an operator.
data Assoc l

-- | non-associative operator (declared with infix)
AssocNone :: l -> Assoc l

-- | left-associative operator (declared with infixl).
AssocLeft :: l -> Assoc l

-- | right-associative operator (declared with infixr)
AssocRight :: l -> Assoc l

-- | A top-level declaration.
data Decl l

-- | A type declaration
TypeDecl :: l -> DeclHead l -> Type l -> Decl l

-- | A type family declaration
TypeFamDecl :: l -> DeclHead l -> Maybe (ResultSig l) -> Maybe (InjectivityInfo l) -> Decl l

-- | A closed type family declaration
ClosedTypeFamDecl :: l -> DeclHead l -> Maybe (ResultSig l) -> Maybe (InjectivityInfo l) -> [TypeEqn l] -> Decl l

-- | A data OR newtype declaration
DataDecl :: l -> DataOrNew l -> Maybe (Context l) -> DeclHead l -> [QualConDecl l] -> [Deriving l] -> Decl l

-- | A data OR newtype declaration, GADT style
GDataDecl :: l -> DataOrNew l -> Maybe (Context l) -> DeclHead l -> Maybe (Kind l) -> [GadtDecl l] -> [Deriving l] -> Decl l

-- | A data family declaration
DataFamDecl :: l -> Maybe (Context l) -> DeclHead l -> Maybe (ResultSig l) -> Decl l

-- | A type family instance declaration
TypeInsDecl :: l -> Type l -> Type l -> Decl l

-- | A data family instance declaration
DataInsDecl :: l -> DataOrNew l -> Type l -> [QualConDecl l] -> [Deriving l] -> Decl l

-- | A data family instance declaration, GADT style
GDataInsDecl :: l -> DataOrNew l -> Type l -> Maybe (Kind l) -> [GadtDecl l] -> [Deriving l] -> Decl l

-- | A declaration of a type class
ClassDecl :: l -> Maybe (Context l) -> DeclHead l -> [FunDep l] -> Maybe [ClassDecl l] -> Decl l

-- | An declaration of a type class instance
InstDecl :: l -> Maybe (Overlap l) -> InstRule l -> Maybe [InstDecl l] -> Decl l

-- | A standalone deriving declaration
DerivDecl :: l -> Maybe (DerivStrategy l) -> Maybe (Overlap l) -> InstRule l -> Decl l

-- | A declaration of operator fixity
InfixDecl :: l -> Assoc l -> Maybe Int -> [Op l] -> Decl l

-- | A declaration of default types
DefaultDecl :: l -> [Type l] -> Decl l

-- | A Template Haskell splicing declaration
SpliceDecl :: l -> Exp l -> Decl l

-- | A type signature declaration
TypeSig :: l -> [Name l] -> Type l -> Decl l

-- | A pattern synonym signature declation
PatSynSig :: l -> [Name l] -> Maybe [TyVarBind l] -> Maybe (Context l) -> Maybe (Context l) -> Type l -> Decl l

-- | A set of function binding clauses
FunBind :: l -> [Match l] -> Decl l

-- | A pattern binding
PatBind :: l -> Pat l -> Rhs l -> Maybe (Binds l) -> Decl l

-- | A pattern synonym binding
PatSyn :: l -> Pat l -> Pat l -> PatternSynDirection l -> Decl l

-- | A foreign import declaration
ForImp :: l -> CallConv l -> Maybe (Safety l) -> Maybe String -> Name l -> Type l -> Decl l

-- | A foreign export declaration
ForExp :: l -> CallConv l -> Maybe String -> Name l -> Type l -> Decl l

-- | A RULES pragma
RulePragmaDecl :: l -> [Rule l] -> Decl l

-- | A DEPRECATED pragma
DeprPragmaDecl :: l -> [([Name l], String)] -> Decl l

-- | A WARNING pragma
WarnPragmaDecl :: l -> [([Name l], String)] -> Decl l

-- | An INLINE pragma
InlineSig :: l -> Bool -> Maybe (Activation l) -> QName l -> Decl l

-- | An INLINE CONLIKE pragma
InlineConlikeSig :: l -> Maybe (Activation l) -> QName l -> Decl l

-- | A SPECIALISE pragma
SpecSig :: l -> Maybe (Activation l) -> QName l -> [Type l] -> Decl l

-- | A SPECIALISE INLINE pragma
SpecInlineSig :: l -> Bool -> Maybe (Activation l) -> QName l -> [Type l] -> Decl l

-- | A SPECIALISE instance pragma
InstSig :: l -> InstRule l -> Decl l

-- | An ANN pragma
AnnPragma :: l -> Annotation l -> Decl l

-- | A MINIMAL pragma
MinimalPragma :: l -> Maybe (BooleanFormula l) -> Decl l

-- | A role annotation
RoleAnnotDecl :: l -> QName l -> [Role l] -> Decl l

-- | A COMPLETE pragma
CompletePragma :: l -> [Name l] -> Maybe (QName l) -> Decl l
data PatternSynDirection l

-- | A unidirectional pattern synonym with "<-"
Unidirectional :: PatternSynDirection l

-- | A bidirectional pattern synonym with "="
ImplicitBidirectional :: PatternSynDirection l

-- | A birectional pattern synonym with the construction specified.
ExplicitBidirectional :: l -> [Decl l] -> PatternSynDirection l

-- | A type equation as found in closed type families.
data TypeEqn l
TypeEqn :: l -> Type l -> Type l -> TypeEqn l

-- | An annotation through an ANN pragma.
data Annotation l

-- | An annotation for a declared name.
Ann :: l -> Name l -> Exp l -> Annotation l

-- | An annotation for a declared type.
TypeAnn :: l -> Name l -> Exp l -> Annotation l

-- | An annotation for the defining module.
ModuleAnn :: l -> Exp l -> Annotation l

-- | A boolean formula for MINIMAL pragmas.
data BooleanFormula l

-- | A variable.
VarFormula :: l -> Name l -> BooleanFormula l

-- | And boolean formulas.
AndFormula :: l -> [BooleanFormula l] -> BooleanFormula l

-- | Or boolean formulas.
OrFormula :: l -> [BooleanFormula l] -> BooleanFormula l

-- | Parenthesized boolean formulas.
ParenFormula :: l -> BooleanFormula l -> BooleanFormula l
data Role l
Nominal :: l -> Role l
Representational :: l -> Role l
Phantom :: l -> Role l
RoleWildcard :: l -> Role l

-- | A flag stating whether a declaration is a data or newtype declaration.
data DataOrNew l
DataType :: l -> DataOrNew l
NewType :: l -> DataOrNew l

-- | Injectivity info for injective type families
data InjectivityInfo l
InjectivityInfo :: l -> Name l -> [Name l] -> InjectivityInfo l
data ResultSig l
KindSig :: l -> Kind l -> ResultSig l
TyVarSig :: l -> TyVarBind l -> ResultSig l

-- | The head of a type or class declaration, which consists of the type or
--   class name applied to some type variables
--   
--   class C a b is represented as
--   
--   
--   DHApp
--      ()
--      (DHApp
--         () (DHead () (Ident () "C")) (UnkindedVar () (Ident () "a")))
--      (UnkindedVar () (Ident () "b"))
--   
--   
--   (where the annotation type l is instantiated with
--   ())
--   
--   class (a :< b) c is represented as
--   
--   
--   DHApp
--      ()
--      (DHParen
--         ()
--         (DHApp
--            ()
--            (DHInfix () (UnkindedVar () (Ident () "a")) (Symbol () ":<"))
--            (UnkindedVar () (Ident () "b"))))
--      (UnkindedVar () (Ident () "c"))
--   
data DeclHead l

-- | type or class name
DHead :: l -> Name l -> DeclHead l

-- | infix application of the type/class name to the left operand
DHInfix :: l -> TyVarBind l -> Name l -> DeclHead l

-- | parenthesized declaration head
DHParen :: l -> DeclHead l -> DeclHead l

-- | application to one more type variable
DHApp :: l -> DeclHead l -> TyVarBind l -> DeclHead l

-- | The instance declaration rule, which is, roughly, the part of the
--   instance declaration before the where keyword.
--   
--   Example: instance Ord a => Ord (Maybe a) is represented as
--   
--   
--   IRule
--      ()
--      Nothing
--      (Just
--         (CxSingle
--            ()
--            (ClassA
--               () (UnQual () (Ident () "Ord")) [ TyVar () (Ident () "a") ])))
--      (IHApp
--         ()
--         (IHCon () (UnQual () (Ident () "Ord")))
--         (TyParen
--            ()
--            (TyApp
--               ()
--               (TyCon () (UnQual () (Ident () "Maybe")))
--               (TyVar () (Ident () "a")))))
--   
--   
--   An optional explicit forall after instance is supported:
--   instance forall a . Ord a => Ord (Maybe a) where becomes
--   
--   
--   IRule
--      ()
--      (Just [ UnkindedVar () (Ident () "a") ])
--      ...
--   
data InstRule l
IRule :: l -> Maybe [TyVarBind l] -> Maybe (Context l) -> InstHead l -> InstRule l
IParen :: l -> InstRule l -> InstRule l

-- | The instance head. The split between rule/head allow us to represent
--   instance (Bounded a => Bounded [a]) where faithfully.
--   
--   The structure of InstHead follows one of DeclHead.
--   
--   For example, instance C (Maybe a) Int where is represented as
--   
--   
--   IHApp
--      ()
--      (IHApp
--         ()
--         (IHCon () (UnQual () (Ident () "C")))
--         (TyParen
--            ()
--            (TyApp
--               ()
--               (TyCon () (UnQual () (Ident () "Maybe")))
--               (TyVar () (Ident () "a")))))
--      (TyCon () (UnQual () (Ident () "Int")))))
--   
data InstHead l

-- | type or class name
IHCon :: l -> QName l -> InstHead l

-- | infix application of the type/class name to the left operand
IHInfix :: l -> Type l -> QName l -> InstHead l

-- | parenthesized instance head
IHParen :: l -> InstHead l -> InstHead l

-- | application to one more type
IHApp :: l -> InstHead l -> Type l -> InstHead l

-- | A deriving clause following a data type declaration.
data Deriving l
Deriving :: l -> Maybe (DerivStrategy l) -> [InstRule l] -> Deriving l

-- | Which technique the user explicitly requested when deriving an
--   instance.
data DerivStrategy l

-- | GHC's "standard" strategy, which is to implement a custom instance for
--   the data type. This only works for certain types that GHC knows about
--   (e.g., Eq, Show, Functor when
--   -XDeriveFunctor is enabled, etc.)
DerivStock :: l -> DerivStrategy l

-- | 
--   -XDeriveAnyClass
--   
DerivAnyclass :: l -> DerivStrategy l

-- | 
--   -XGeneralizedNewtypeDeriving
--   
DerivNewtype :: l -> DerivStrategy l

-- | A binding group inside a let or where clause.
data Binds l

-- | An ordinary binding group
BDecls :: l -> [Decl l] -> Binds l

-- | A binding group for implicit parameters
IPBinds :: l -> [IPBind l] -> Binds l

-- | A binding of an implicit parameter.
data IPBind l
IPBind :: l -> IPName l -> Exp l -> IPBind l

-- | Clauses of a function binding.
data Match l

-- | A clause defined with prefix notation, i.e. the function name followed
--   by its argument patterns, the right-hand side and an optional where
--   clause.
Match :: l -> Name l -> [Pat l] -> Rhs l -> Maybe (Binds l) -> Match l

-- | A clause defined with infix notation, i.e. first its first argument
--   pattern, then the function name, then its following argument(s), the
--   right-hand side and an optional where clause. Note that there can be
--   more than two arguments to a function declared infix, hence the list
--   of pattern arguments.
InfixMatch :: l -> Pat l -> Name l -> [Pat l] -> Rhs l -> Maybe (Binds l) -> Match l

-- | A single constructor declaration within a data type declaration, which
--   may have an existential quantification binding.
data QualConDecl l
QualConDecl :: l -> Maybe [TyVarBind l] -> Maybe (Context l) -> ConDecl l -> QualConDecl l

-- | Declaration of an ordinary data constructor.
data ConDecl l

-- | ordinary data constructor
ConDecl :: l -> Name l -> [Type l] -> ConDecl l

-- | infix data constructor
InfixConDecl :: l -> Type l -> Name l -> Type l -> ConDecl l

-- | record constructor
RecDecl :: l -> Name l -> [FieldDecl l] -> ConDecl l

-- | A single constructor declaration in a GADT data type declaration.
--   
--   If the GADT is declared using the record syntax, e.g.
--   
--   
--   data Ty where
--     TCon :: { field1 :: Int, field2 :: Bool } -> Ty
--   
--   
--   then the fields are stored as a list of FieldDecls, and the
--   final type (Ty in the above example) is stored in the last
--   Type field.
--   
--   If the GADT is declared using the ordinary syntax, e.g.
--   
--   
--   data Ty where
--     TCon :: Int -> Bool -> Ty
--   
--   
--   then Maybe [FieldDecl l] is Nothing, and
--   the whole constructor's type (such as Int -> Bool ->
--   Ty) is stored in the last Type field.
data GadtDecl l
GadtDecl :: l -> Name l -> Maybe [FieldDecl l] -> Type l -> GadtDecl l

-- | Declarations inside a class declaration.
data ClassDecl l

-- | ordinary declaration
ClsDecl :: l -> Decl l -> ClassDecl l

-- | declaration of an associated data type
ClsDataFam :: l -> Maybe (Context l) -> DeclHead l -> Maybe (ResultSig l) -> ClassDecl l

-- | declaration of an associated type synonym
ClsTyFam :: l -> DeclHead l -> Maybe (ResultSig l) -> Maybe (InjectivityInfo l) -> ClassDecl l

-- | default choice for an associated type synonym
ClsTyDef :: l -> TypeEqn l -> ClassDecl l

-- | default signature
ClsDefSig :: l -> Name l -> Type l -> ClassDecl l

-- | Declarations inside an instance declaration.
data InstDecl l

-- | ordinary declaration
InsDecl :: l -> Decl l -> InstDecl l

-- | an associated type definition
InsType :: l -> Type l -> Type l -> InstDecl l

-- | an associated data type implementation
InsData :: l -> DataOrNew l -> Type l -> [QualConDecl l] -> [Deriving l] -> InstDecl l

-- | an associated data type implemented using GADT style
InsGData :: l -> DataOrNew l -> Type l -> Maybe (Kind l) -> [GadtDecl l] -> [Deriving l] -> InstDecl l

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

-- | strict component, marked with "!"
BangedTy :: l -> BangType l

-- | lazy component, marked with "~"
LazyTy :: l -> BangType l

-- | No strictness information
NoStrictAnnot :: l -> BangType l
data Unpackedness l

-- | "{-# UNPACK #-}"
Unpack :: l -> Unpackedness l

-- | "{-# NOUNPACK #-}"
NoUnpack :: l -> Unpackedness l

-- | No unpack pragma
NoUnpackPragma :: l -> Unpackedness l

-- | The right hand side of a function binding, pattern binding, or a case
--   alternative.
data Rhs l

-- | unguarded right hand side (exp)
UnGuardedRhs :: l -> Exp l -> Rhs l

-- | guarded right hand side (gdrhs)
GuardedRhss :: l -> [GuardedRhs l] -> Rhs l

-- | A guarded right hand side | stmts =
--   exp, or | stmts -> exp for
--   case alternatives. The guard is a series of statements when using
--   pattern guards, otherwise it will be a single qualifier expression.
data GuardedRhs l
GuardedRhs :: l -> [Stmt l] -> Exp l -> GuardedRhs l

-- | A type qualified with a context. An unqualified type has an empty
--   context.
data Type l

-- | qualified type
TyForall :: l -> Maybe [TyVarBind l] -> Maybe (Context l) -> Type l -> Type l

-- | function type
TyFun :: l -> Type l -> Type l -> Type l

-- | tuple type, possibly boxed
TyTuple :: l -> Boxed -> [Type l] -> Type l

-- | unboxed tuple type
TyUnboxedSum :: l -> [Type l] -> Type l

-- | list syntax, e.g. [a], as opposed to [] a
TyList :: l -> Type l -> Type l

-- | parallel array syntax, e.g. [:a:]
TyParArray :: l -> Type l -> Type l

-- | application of a type constructor
TyApp :: l -> Type l -> Type l -> Type l

-- | type variable
TyVar :: l -> Name l -> Type l

-- | named type or type constructor
TyCon :: l -> QName l -> Type l

-- | type surrounded by parentheses
TyParen :: l -> Type l -> Type l

-- | infix type constructor
TyInfix :: l -> Type l -> MaybePromotedName l -> Type l -> Type l

-- | type with explicit kind signature
TyKind :: l -> Type l -> Kind l -> Type l

-- | 'K, a promoted data type (-XDataKinds).
TyPromoted :: l -> Promoted l -> Type l

-- | type equality predicate enabled by ConstraintKinds
TyEquals :: l -> Type l -> Type l -> Type l

-- | template haskell splice type
TySplice :: l -> Splice l -> Type l

-- | Strict type marked with "!" or type marked with UNPACK
--   pragma.
TyBang :: l -> BangType l -> Unpackedness l -> Type l -> Type l

-- | Either an anonymous of named type wildcard
TyWildCard :: l -> Maybe (Name l) -> Type l

-- | 
--   [$name| string |]
--   
TyQuasiQuote :: l -> String -> String -> Type l
data MaybePromotedName l
PromotedName :: l -> QName l -> MaybePromotedName l
UnpromotedName :: l -> QName l -> MaybePromotedName l

-- | Bools here are True if there was a leading quote which may be left
--   out. For example '[k1,k2] means the same thing as
--   [k1,k2].
data Promoted l

-- | parsed value and raw string
PromotedInteger :: l -> Integer -> String -> Promoted l

-- | parsed value and raw string
PromotedString :: l -> String -> String -> Promoted l
PromotedCon :: l -> Bool -> QName l -> Promoted l
PromotedList :: l -> Bool -> [Type l] -> Promoted l
PromotedTuple :: l -> [Type l] -> Promoted l
PromotedUnit :: l -> Promoted l

-- | Flag denoting whether a tuple is boxed or unboxed.
data Boxed
Boxed :: Boxed
Unboxed :: Boxed

-- | A type variable declaration, optionally with an explicit kind
--   annotation.
data TyVarBind l

-- | variable binding with kind annotation
KindedVar :: l -> Name l -> Kind l -> TyVarBind l

-- | ordinary variable binding
UnkindedVar :: l -> Name l -> TyVarBind l

-- | An explicit kind annotation.
data Kind l

-- | *, the kind of types
KindStar :: l -> Kind l

-- | ->, the kind of a type constructor
KindFn :: l -> Kind l -> Kind l -> Kind l

-- | a parenthesised kind
KindParen :: l -> Kind l -> Kind l

-- | k, a kind variable (-XPolyKinds)
KindVar :: l -> QName l -> Kind l

-- | 
--   k1 k2
--   
KindApp :: l -> Kind l -> Kind l -> Kind l

-- | '(k1,k2,k3), a promoted tuple
KindTuple :: l -> [Kind l] -> Kind l

-- | '[k1], a promoted list literal
KindList :: l -> Kind l -> Kind l

-- | A functional dependency, given on the form l1 l2 ... ln -> r2 r3 ..
--   rn
data FunDep l
FunDep :: l -> [Name l] -> [Name l] -> FunDep l

-- | A context is a set of assertions
data Context l
CxSingle :: l -> Asst l -> Context l
CxTuple :: l -> [Asst l] -> Context l
CxEmpty :: l -> Context l

-- | Class assertions. In Haskell 98, the argument would be a tyvar,
--   but this definition allows multiple parameters, and allows them to be
--   types. Also extended with support for implicit parameters and
--   equality constraints.
data Asst l

-- | ordinary class assertion
ClassA :: l -> QName l -> [Type l] -> Asst l

-- | constraint kind assertion, Dict :: cxt a => Dict cxt
AppA :: l -> Name l -> [Type l] -> Asst l

-- | class assertion where the class name is given infix
InfixA :: l -> Type l -> QName l -> Type l -> Asst l

-- | implicit parameter assertion
IParam :: l -> IPName l -> Type l -> Asst l

-- | type equality constraint
EqualP :: l -> Type l -> Type l -> Asst l

-- | parenthesised class assertion
ParenA :: l -> Asst l -> Asst l

-- | Context Wildcard
WildCardA :: l -> Maybe (Name l) -> Asst l

-- | literal Values of this type hold the abstract value of the
--   literal, along with the precise string representation used. For
--   example, 10, 0o12 and 0xa have the same
--   value representation, but each carry a different string
--   representation.
data Literal l

-- | character literal
Char :: l -> Char -> String -> Literal l

-- | string literal
String :: l -> String -> String -> Literal l

-- | integer literal
Int :: l -> Integer -> String -> Literal l

-- | floating point literal
Frac :: l -> Rational -> String -> Literal l

-- | unboxed integer literal
PrimInt :: l -> Integer -> String -> Literal l

-- | unboxed word literal
PrimWord :: l -> Integer -> String -> Literal l

-- | unboxed float literal
PrimFloat :: l -> Rational -> String -> Literal l

-- | unboxed double literal
PrimDouble :: l -> Rational -> String -> Literal l

-- | unboxed character literal
PrimChar :: l -> Char -> String -> Literal l

-- | unboxed string literal
PrimString :: l -> String -> String -> Literal l

-- | An indication whether a literal pattern has been negated or not.
data Sign l
Signless :: l -> Sign l
Negative :: l -> Sign l

-- | Haskell expressions.
data Exp l

-- | variable
Var :: l -> QName l -> Exp l

-- | Overloaded label #foo
OverloadedLabel :: l -> String -> Exp l

-- | implicit parameter variable
IPVar :: l -> IPName l -> Exp l

-- | data constructor
Con :: l -> QName l -> Exp l

-- | literal constant
Lit :: l -> Literal l -> Exp l

-- | infix application
InfixApp :: l -> Exp l -> QOp l -> Exp l -> Exp l

-- | ordinary application
App :: l -> Exp l -> Exp l -> Exp l

-- | negation expression -exp (unary minus)
NegApp :: l -> Exp l -> Exp l

-- | lambda expression
Lambda :: l -> [Pat l] -> Exp l -> Exp l

-- | local declarations with let ... in ...
Let :: l -> Binds l -> Exp l -> Exp l

-- | if exp then exp else
--   exp
If :: l -> Exp l -> Exp l -> Exp l -> Exp l

-- | if | stmts -> exp ...
MultiIf :: l -> [GuardedRhs l] -> Exp l

-- | case exp of alts
Case :: l -> Exp l -> [Alt l] -> Exp l

-- | do-expression: the last statement in the list should be an
--   expression.
Do :: l -> [Stmt l] -> Exp l

-- | mdo-expression
MDo :: l -> [Stmt l] -> Exp l

-- | tuple expression
Tuple :: l -> Boxed -> [Exp l] -> Exp l

-- | unboxed sum
UnboxedSum :: l -> Int -> Int -> Exp l -> Exp l

-- | tuple section expression, e.g. (,,3)
TupleSection :: l -> Boxed -> [Maybe (Exp l)] -> Exp l

-- | list expression
List :: l -> [Exp l] -> Exp l

-- | parallel array expression
ParArray :: l -> [Exp l] -> Exp l

-- | parenthesised expression
Paren :: l -> Exp l -> Exp l

-- | left section (exp qop)
LeftSection :: l -> Exp l -> QOp l -> Exp l

-- | right section (qop exp)
RightSection :: l -> QOp l -> Exp l -> Exp l

-- | record construction expression
RecConstr :: l -> QName l -> [FieldUpdate l] -> Exp l

-- | record update expression
RecUpdate :: l -> Exp l -> [FieldUpdate l] -> Exp l

-- | unbounded arithmetic sequence, incrementing by 1: [from ..]
EnumFrom :: l -> Exp l -> Exp l

-- | bounded arithmetic sequence, incrementing by 1 [from .. to]
EnumFromTo :: l -> Exp l -> Exp l -> Exp l

-- | unbounded arithmetic sequence, with first two elements given
--   [from, then ..]
EnumFromThen :: l -> Exp l -> Exp l -> Exp l

-- | bounded arithmetic sequence, with first two elements given [from,
--   then .. to]
EnumFromThenTo :: l -> Exp l -> Exp l -> Exp l -> Exp l

-- | Parallel array bounded arithmetic sequence, incrementing by 1
--   [:from .. to:]
ParArrayFromTo :: l -> Exp l -> Exp l -> Exp l

-- | bounded arithmetic sequence, with first two elements given [:from,
--   then .. to:]
ParArrayFromThenTo :: l -> Exp l -> Exp l -> Exp l -> Exp l

-- | ordinary list comprehension
ListComp :: l -> Exp l -> [QualStmt l] -> Exp l

-- | parallel list comprehension
ParComp :: l -> Exp l -> [[QualStmt l]] -> Exp l

-- | parallel array comprehension
ParArrayComp :: l -> Exp l -> [[QualStmt l]] -> Exp l

-- | expression with explicit type signature
ExpTypeSig :: l -> Exp l -> Type l -> Exp l

-- | 'x for template haskell reifying of expressions
VarQuote :: l -> QName l -> Exp l

-- | ''T for template haskell reifying of types
TypQuote :: l -> QName l -> Exp l

-- | template haskell bracket expression
BracketExp :: l -> Bracket l -> Exp l

-- | template haskell splice expression
SpliceExp :: l -> Splice l -> Exp l

-- | quasi-quotaion: [$name| string |]
QuasiQuote :: l -> String -> String -> Exp l

-- | Visible type application
TypeApp :: l -> Type l -> Exp l

-- | xml element, with attributes and children
XTag :: l -> XName l -> [XAttr l] -> Maybe (Exp l) -> [Exp l] -> Exp l

-- | empty xml element, with attributes
XETag :: l -> XName l -> [XAttr l] -> Maybe (Exp l) -> Exp l

-- | PCDATA child element
XPcdata :: l -> String -> Exp l

-- | escaped haskell expression inside xml
XExpTag :: l -> Exp l -> Exp l

-- | children of an xml element
XChildTag :: l -> [Exp l] -> Exp l

-- | CORE pragma
CorePragma :: l -> String -> Exp l -> Exp l

-- | SCC pragma
SCCPragma :: l -> String -> Exp l -> Exp l

-- | GENERATED pragma
GenPragma :: l -> String -> (Int, Int) -> (Int, Int) -> Exp l -> Exp l

-- | arrows proc: proc pat -> exp
Proc :: l -> Pat l -> Exp l -> Exp l

-- | arrow application (from left): exp -< exp
LeftArrApp :: l -> Exp l -> Exp l -> Exp l

-- | arrow application (from right): exp >- exp
RightArrApp :: l -> Exp l -> Exp l -> Exp l

-- | higher-order arrow application (from left): exp
--   -<< exp
LeftArrHighApp :: l -> Exp l -> Exp l -> Exp l

-- | higher-order arrow application (from right): exp
--   >>- exp
RightArrHighApp :: l -> Exp l -> Exp l -> Exp l

-- | case alts
LCase :: l -> [Alt l] -> Exp l

-- | The name of an xml element or attribute, possibly qualified with a
--   namespace.
data XName l
XName :: l -> String -> XName l
XDomName :: l -> String -> String -> XName l

-- | An xml attribute, which is a name-expression pair.
data XAttr l
XAttr :: l -> XName l -> Exp l -> XAttr l

-- | A template haskell bracket expression.
data Bracket l

-- | expression bracket: [| ... |]
ExpBracket :: l -> Exp l -> Bracket l

-- | pattern bracket: [p| ... |]
PatBracket :: l -> Pat l -> Bracket l

-- | type bracket: [t| ... |]
TypeBracket :: l -> Type l -> Bracket l

-- | declaration bracket: [d| ... |]
DeclBracket :: l -> [Decl l] -> Bracket l

-- | A template haskell splice expression
data Splice l

-- | variable splice: $var
IdSplice :: l -> String -> Splice l

-- | parenthesised expression splice: $(exp)
ParenSplice :: l -> Exp l -> Splice l

-- | The safety of a foreign function call.
data Safety l

-- | unsafe
PlayRisky :: l -> Safety l

-- | safe (False) or threadsafe (True)
PlaySafe :: l -> Bool -> Safety l

-- | interruptible
PlayInterruptible :: l -> Safety l

-- | The calling convention of a foreign function call.
data CallConv l
StdCall :: l -> CallConv l
CCall :: l -> CallConv l
CPlusPlus :: l -> CallConv l
DotNet :: l -> CallConv l
Jvm :: l -> CallConv l
Js :: l -> CallConv l
JavaScript :: l -> CallConv l
CApi :: l -> CallConv l

-- | A top level options pragma, preceding the module header.
data ModulePragma l

-- | LANGUAGE pragma
LanguagePragma :: l -> [Name l] -> ModulePragma l

-- | OPTIONS pragma, possibly qualified with a tool, e.g. OPTIONS_GHC
OptionsPragma :: l -> Maybe Tool -> String -> ModulePragma l

-- | ANN pragma with module scope
AnnModulePragma :: l -> Annotation l -> ModulePragma l

-- | Recognised tools for OPTIONS pragmas.
data Tool
GHC :: Tool
HUGS :: Tool
NHC98 :: Tool
YHC :: Tool
HADDOCK :: Tool
UnknownTool :: String -> Tool

-- | Recognised overlaps for overlap pragmas.
data Overlap l

-- | NO_OVERLAP pragma
NoOverlap :: l -> Overlap l

-- | OVERLAP pragma
Overlap :: l -> Overlap l
Overlapping :: l -> Overlap l
Overlaps :: l -> Overlap l
Overlappable :: l -> Overlap l

-- | INCOHERENT pragma
Incoherent :: l -> Overlap l

-- | Activation clause of a RULES pragma.
data Activation l
ActiveFrom :: l -> Int -> Activation l
ActiveUntil :: l -> Int -> Activation l

-- | The body of a RULES pragma.
data Rule l
Rule :: l -> String -> Maybe (Activation l) -> Maybe [RuleVar l] -> Exp l -> Exp l -> Rule l

-- | Variables used in a RULES pragma, optionally annotated with types
data RuleVar l
RuleVar :: l -> Name l -> RuleVar l
TypedRuleVar :: l -> Name l -> Type l -> RuleVar l

-- | Warning text to optionally use in the module header of e.g. a
--   deprecated module.
data WarningText l
DeprText :: l -> String -> WarningText l
WarnText :: l -> String -> WarningText l

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

-- | variable
PVar :: l -> Name l -> Pat l

-- | literal constant
PLit :: l -> Sign l -> Literal l -> Pat l

-- | n+k pattern
PNPlusK :: l -> Name l -> Integer -> Pat l

-- | pattern with an infix data constructor
PInfixApp :: l -> Pat l -> QName l -> Pat l -> Pat l

-- | data constructor and argument patterns
PApp :: l -> QName l -> [Pat l] -> Pat l

-- | tuple pattern
PTuple :: l -> Boxed -> [Pat l] -> Pat l

-- | unboxed sum
PUnboxedSum :: l -> Int -> Int -> Pat l -> Pat l

-- | list pattern
PList :: l -> [Pat l] -> Pat l

-- | parenthesized pattern
PParen :: l -> Pat l -> Pat l

-- | labelled pattern, record style
PRec :: l -> QName l -> [PatField l] -> Pat l

-- | @-pattern
PAsPat :: l -> Name l -> Pat l -> Pat l

-- | wildcard pattern: _
PWildCard :: l -> Pat l

-- | irrefutable pattern: ~pat
PIrrPat :: l -> Pat l -> Pat l

-- | pattern with type signature
PatTypeSig :: l -> Pat l -> Type l -> Pat l

-- | view patterns of the form (exp -> pat)
PViewPat :: l -> Exp l -> Pat l -> Pat l

-- | regular list pattern
PRPat :: l -> [RPat l] -> Pat l

-- | XML element pattern
PXTag :: l -> XName l -> [PXAttr l] -> Maybe (Pat l) -> [Pat l] -> Pat l

-- | XML singleton element pattern
PXETag :: l -> XName l -> [PXAttr l] -> Maybe (Pat l) -> Pat l

-- | XML PCDATA pattern
PXPcdata :: l -> String -> Pat l

-- | XML embedded pattern
PXPatTag :: l -> Pat l -> Pat l

-- | XML regular list pattern
PXRPats :: l -> [RPat l] -> Pat l

-- | template haskell splice pattern
PSplice :: l -> Splice l -> Pat l

-- | quasi quote pattern: [$name| string |]
PQuasiQuote :: l -> String -> String -> Pat l

-- | strict (bang) pattern: f !x = ...
PBangPat :: l -> Pat l -> Pat l

-- | An XML attribute in a pattern.
data PXAttr l
PXAttr :: l -> XName l -> Pat l -> PXAttr l

-- | A regular pattern operator.
data RPatOp l

-- | * = 0 or more
RPStar :: l -> RPatOp l

-- | *! = 0 or more, greedy
RPStarG :: l -> RPatOp l

-- | + = 1 or more
RPPlus :: l -> RPatOp l

-- | +! = 1 or more, greedy
RPPlusG :: l -> RPatOp l

-- | ? = 0 or 1
RPOpt :: l -> RPatOp l

-- | ?! = 0 or 1, greedy
RPOptG :: l -> RPatOp l

-- | An entity in a regular pattern.
data RPat l

-- | operator pattern, e.g. pat*
RPOp :: l -> RPat l -> RPatOp l -> RPat l

-- | choice pattern, e.g. (1 | 2)
RPEither :: l -> RPat l -> RPat l -> RPat l

-- | sequence pattern, e.g. (| 1, 2, 3 |)
RPSeq :: l -> [RPat l] -> RPat l

-- | guarded pattern, e.g. (| p | p < 3 |)
RPGuard :: l -> Pat l -> [Stmt l] -> RPat l

-- | non-linear variable binding, e.g. (foo@:(1 | 2))*
RPCAs :: l -> Name l -> RPat l -> RPat l

-- | linear variable binding, e.g. foo@(1 | 2)
RPAs :: l -> Name l -> RPat l -> RPat l

-- | parenthesised pattern, e.g. (2*)
RPParen :: l -> RPat l -> RPat l

-- | an ordinary pattern
RPPat :: l -> Pat l -> RPat l

-- | An fpat in a labeled record pattern.
data PatField l

-- | ordinary label-pattern pair
PFieldPat :: l -> QName l -> Pat l -> PatField l

-- | record field pun
PFieldPun :: l -> QName l -> PatField l

-- | record field wildcard
PFieldWildcard :: l -> PatField l

-- | A statement, representing both a stmt in a
--   do-expression, an ordinary qual in a list
--   comprehension, as well as a stmt in a pattern guard.
data Stmt l

-- | a generator: pat <- exp
Generator :: l -> Pat l -> Exp l -> Stmt l

-- | an exp by itself: in a do-expression, an action whose
--   result is discarded; in a list comprehension and pattern guard, a
--   guard expression
Qualifier :: l -> Exp l -> Stmt l

-- | local bindings
LetStmt :: l -> Binds l -> Stmt l

-- | a recursive binding group for arrows
RecStmt :: l -> [Stmt l] -> Stmt l

-- | A general transqual in a list comprehension, which could
--   potentially be a transform of the kind enabled by TransformListComp.
data QualStmt l

-- | an ordinary statement
QualStmt :: l -> Stmt l -> QualStmt l

-- | then exp
ThenTrans :: l -> Exp l -> QualStmt l

-- | then exp by exp
ThenBy :: l -> Exp l -> Exp l -> QualStmt l

-- | then group by exp
GroupBy :: l -> Exp l -> QualStmt l

-- | then group using exp
GroupUsing :: l -> Exp l -> QualStmt l

-- | then group by exp using
--   exp
GroupByUsing :: l -> Exp l -> Exp l -> QualStmt l

-- | An fbind in a labeled construction or update expression.
data FieldUpdate l

-- | ordinary label-expresion pair
FieldUpdate :: l -> QName l -> Exp l -> FieldUpdate l

-- | record field pun
FieldPun :: l -> QName l -> FieldUpdate l

-- | record field wildcard
FieldWildcard :: l -> FieldUpdate l

-- | An alt alternative in a case expression.
data Alt l
Alt :: l -> Pat l -> Rhs l -> Maybe (Binds l) -> Alt l

-- | AST nodes are annotated, and this class allows manipulation of the
--   annotations.
class Functor ast => Annotated (ast :: Type -> Type)

-- | Retrieve the annotation of an AST node.
ann :: Annotated ast => ast l -> l

-- | Change the annotation of an AST node. Note that only the annotation of
--   the node itself is affected, and not the annotations of any child
--   nodes. if all nodes in the AST tree are to be affected, use
--   fmap.
amap :: Annotated ast => (l -> l) -> ast l -> ast l

-- | Merge two SrcSpans and lift them to a SrcInfoSpan with
--   no positional information for entities.
(<^^>) :: SrcSpan -> SrcSpan -> SrcSpanInfo
infixl 6 <^^>

-- | Add more positional information for entities of a span.
(<**) :: SrcSpanInfo -> [SrcSpan] -> SrcSpanInfo
infixl 4 <**

-- | Optionally combine the second argument with the first, or return it
--   unchanged if the first argument is Nothing.
(<?+>) :: Maybe SrcSpanInfo -> SrcSpanInfo -> SrcSpanInfo
infixl 4 <?+>

-- | Optionally combine the first argument with the second, or return it
--   unchanged if the second argument is Nothing.
(<+?>) :: SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo
infixl 4 <+?>

-- | Short name for combSpanInfo
(<++>) :: SrcSpanInfo -> SrcSpanInfo -> SrcSpanInfo
infixl 5 <++>

-- | Like '(+?)', but it also concatenates the srcInfoPoints.
combSpanMaybe :: SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo

-- | Combine two SrcSpanInfos into one that spans the combined
--   source area of the two arguments, leaving positional information
--   blank.
combSpanInfo :: SrcSpanInfo -> SrcSpanInfo -> SrcSpanInfo

-- | Generate a SrcSpanInfo with the supplied positional information
--   for entities.
infoSpan :: SrcSpan -> [SrcSpan] -> SrcSpanInfo

-- | A bogus SrcSpanInfo, the location is noLoc. `noSrcSpan
--   = noInfoSpan (mkSrcSpan noLoc noLoc)`
noSrcSpan :: SrcSpanInfo

-- | Generate a SrcSpanInfo with no positional information for
--   entities.
noInfoSpan :: SrcSpan -> SrcSpanInfo
spanSize :: SrcSpan -> (Int, Int)

-- | Test if a given span starts and ends at the same location.
isNullSpan :: SrcSpan -> Bool

-- | Merge two source spans into a single span from the start of the first
--   to the end of the second. Assumes that the two spans relate to the
--   same source file.
mergeSrcSpan :: SrcSpan -> SrcSpan -> SrcSpan

-- | Combine two locations in the source to denote a span.
mkSrcSpan :: SrcLoc -> SrcLoc -> SrcSpan

-- | Returns srcSpanEndLine and srcSpanEndColumn in a pair.
srcSpanEnd :: SrcSpan -> (Int, Int)

-- | Returns srcSpanStartLine and srcSpanStartColumn in a
--   pair.
srcSpanStart :: SrcSpan -> (Int, Int)
noLoc :: SrcLoc

-- | A single position in the source.
data SrcLoc
SrcLoc :: String -> Int -> Int -> SrcLoc
[srcFilename] :: SrcLoc -> String
[srcLine] :: SrcLoc -> Int
[srcColumn] :: SrcLoc -> Int

-- | A portion of the source, spanning one or more lines and zero or more
--   columns.
data SrcSpan
SrcSpan :: String -> Int -> Int -> Int -> Int -> SrcSpan
[srcSpanFilename] :: SrcSpan -> String
[srcSpanStartLine] :: SrcSpan -> Int
[srcSpanStartColumn] :: SrcSpan -> Int
[srcSpanEndLine] :: SrcSpan -> Int
[srcSpanEndColumn] :: SrcSpan -> Int

-- | An entity located in the source.
data Loc a
Loc :: SrcSpan -> a -> Loc a
[loc] :: Loc a -> SrcSpan
[unLoc] :: Loc a -> a

-- | A portion of the source, extended with information on the position of
--   entities within the span.
data SrcSpanInfo
SrcSpanInfo :: SrcSpan -> [SrcSpan] -> SrcSpanInfo
[srcInfoSpan] :: SrcSpanInfo -> SrcSpan
[srcInfoPoints] :: SrcSpanInfo -> [SrcSpan]

-- | A class to work over all kinds of source location information.
class SrcInfo si
toSrcInfo :: SrcInfo si => SrcLoc -> [SrcSpan] -> SrcLoc -> si
fromSrcInfo :: SrcInfo si => SrcSpanInfo -> si
getPointLoc :: SrcInfo si => si -> SrcLoc
fileName :: SrcInfo si => si -> String
startLine :: SrcInfo si => si -> Int
startColumn :: SrcInfo si => si -> Int
toExtensionList :: Language -> [Extension] -> [KnownExtension]

-- | Pretty print an extension. Disabled extensions are prefixed with 'No'.
prettyExtension :: Extension -> String

-- | Parse an enabled or disabled extension; returns
--   UnknownExtension if the parse fails.
parseExtension :: String -> Extension

-- | A clever version of read that returns an UnknownExtension if
--   the string is not recognised.
classifyExtension :: String -> Extension

-- | Extensions that have been deprecated, possibly paired with another
--   extension that replaces it.
deprecatedExtensions :: [(Extension, Maybe Extension)]

-- | List of all known extensions, both "yes" and "no" versions.
knownExtensions :: [Extension]
ghcDefault :: [Extension]

-- | The list of extensions enabled by GHC's portmanteau -fglasgow-exts
--   flag.
glasgowExts :: [Extension]

-- | Certain extensions imply other extensions, and this function makes the
--   implication explicit. This also handles deprecated extensions, which
--   imply their replacements. The returned value is the transitive closure
--   of implied extensions.
impliesExts :: [KnownExtension] -> [KnownExtension]
prettyLanguage :: Language -> String
classifyLanguage :: String -> Language
knownLanguages :: [Language]
data Language

-- | The Haskell 98 language as defined by the Haskell 98 report.
--   http://haskell.org/onlinereport/
Haskell98 :: Language

-- | The Haskell 2010 language as defined by the Haskell 2010 report.
--   http://www.haskell.org/onlinereport/haskell2010
Haskell2010 :: Language

-- | The minimal language resulting from disabling all recognized
--   extensions - including ones that are part of all known language
--   definitions e.g. MonomorphismRestriction.
HaskellAllDisabled :: Language

-- | An unknown language, identified by its name.
UnknownLanguage :: String -> Language

-- | This represents language extensions beyond a base Language
--   definition (such as Haskell98) that are supported by some
--   implementations, usually in some special mode.
data Extension

-- | Enable a known extension
EnableExtension :: KnownExtension -> Extension

-- | Disable a known extension
DisableExtension :: KnownExtension -> Extension

-- | An unknown extension, identified by the name of its LANGUAGE
--   pragma.
UnknownExtension :: String -> Extension
data KnownExtension

-- | 
--   
- GHC § 7.6.3.4 Allow overlapping class instances, provided
--   there is a unique most specific instance for each use.
--   
OverlappingInstances :: KnownExtension

-- | 
--   
- GHC § 7.6.3.3 Ignore structural rules guaranteeing the
--   termination of class instance resolution. Termination is guaranteed by
--   a fixed-depth recursion stack, and compilation may fail if this depth
--   is exceeded.
--   
UndecidableInstances :: KnownExtension

-- | 
--   
- GHC § 7.6.3.4 Implies OverlappingInstances. Allow
--   the implementation to choose an instance even when it is possible that
--   further instantiation of types will lead to a more specific instance
--   being applicable.
--   
IncoherentInstances :: KnownExtension

-- | 
--   
- GHC § 7.6.3.5 Allow type signatures in instances.
--   
InstanceSigs :: KnownExtension

-- | 
--   
- GHC § 7.3.8 Deprecated in GHC. Allows recursive bindings in
--   do blocks, using the rec keyword.
--   
DoRec :: KnownExtension

-- | 
--   
- GHC § 7.3.8.2 Allows recursive bindings using mdo,
--   a variant of do, and rec.
--   
RecursiveDo :: KnownExtension

-- | 
--   
- GHC § 7.3.9 Provide syntax for writing list comprehensions
--   which iterate over several lists together, like the zipWith
--   family of functions.
--   
ParallelListComp :: KnownExtension

-- | 
--   
- GHC § 7.6.1.1 Allow multiple parameters in a type
--   class.
--   
MultiParamTypeClasses :: KnownExtension

-- | 
--   
- GHC § 7.17 Enable the dreaded monomorphism
--   restriction.
--   
MonomorphismRestriction :: KnownExtension

-- | 
--   
- GHC § 7.6.2 Allow a specification attached to a
--   multi-parameter type class which indicates that some parameters are
--   entirely determined by others. The implementation will check that this
--   property holds for the declared instances, and will use this property
--   to reduce ambiguity in instance resolution.
--   
FunctionalDependencies :: KnownExtension

-- | 
--   
- GHC § 7.8.5 Like RankNTypes but does not allow a
--   higher-rank type to itself appear on the left of a function
--   arrow.
--   
Rank2Types :: KnownExtension

-- | 
--   
- GHC § 7.8.5 Allow a universally-quantified type to occur on
--   the left of a function arrow.
--   
RankNTypes :: KnownExtension

-- | 
--   
- GHC § 7.8.5 Allow data constructors to have polymorphic
--   arguments. Unlike RankNTypes, does not allow this for ordinary
--   functions.
--   
PolymorphicComponents :: KnownExtension

-- | 
--   
- GHC § 7.4.4 Allow existentially-quantified data
--   constructors.
--   
ExistentialQuantification :: KnownExtension

-- | 
--   
- GHC § 7.8.7 Cause a type variable in a signature, which has
--   an explicit forall quantifier, to scope over the definition
--   of the accompanying value declaration.
--   
ScopedTypeVariables :: KnownExtension

-- | Deprecated, use ScopedTypeVariables instead.
PatternSignatures :: KnownExtension

-- | 
--   
- GHC § 7.8.3 Enable implicit function parameters with
--   dynamic scope.
--   
ImplicitParams :: KnownExtension

-- | 
--   
- GHC § 7.8.2 Relax some restrictions on the form of the
--   context of a type signature.
--   
FlexibleContexts :: KnownExtension

-- | 
--   
- GHC § 7.6.3.2 Relax some restrictions on the form of the
--   context of an instance declaration.
--   
FlexibleInstances :: KnownExtension

-- | 
--   
- GHC § 7.4.1 Allow data type declarations with no
--   constructors.
--   
EmptyDataDecls :: KnownExtension

-- | 
--   
- GHC § 4.10.3 Run the C preprocessor on Haskell source
--   code.
--   
CPP :: KnownExtension

-- | 
--   
- GHC § 7.8.4 Allow an explicit kind signature giving the
--   kind of types over which a type variable ranges.
--   
KindSignatures :: KnownExtension

-- | 
--   
- GHC § 7.11 Enable a form of pattern which forces evaluation
--   before an attempted match, and a form of strict
--   let/where binding.
--   
BangPatterns :: KnownExtension

-- | 
--   
- GHC § 7.6.3.1 Allow type synonyms in instance heads.
--   
TypeSynonymInstances :: KnownExtension

-- | 
--   
- GHC § 7.9 Enable Template Haskell, a system for
--   compile-time metaprogramming.
--   
TemplateHaskell :: KnownExtension

-- | 
--   
- GHC § 8 Enable the Foreign Function Interface. In GHC,
--   implements the standard Haskell 98 Foreign Function Interface
--   Addendum, plus some GHC-specific extensions.
--   
ForeignFunctionInterface :: KnownExtension

-- | 
--   
- GHC § 7.10 Enable arrow notation.
--   
Arrows :: KnownExtension

-- | 
--   
- GHC § 7.16 Enable generic type classes, with default
--   instances defined in terms of the algebraic structure of a type.
--   
Generics :: KnownExtension

-- | 
--   
- GHC § 7.3.11 Enable the implicit importing of the module
--   Prelude. When disabled, when desugaring certain built-in
--   syntax into ordinary identifiers, use whatever is in scope rather than
--   the Prelude -- version.
--   
ImplicitPrelude :: KnownExtension

-- | 
--   
- GHC § 7.3.15 Enable syntax for implicitly binding local
--   names corresponding to the field names of a record. Puns bind specific
--   names, unlike RecordWildCards.
--   
NamedFieldPuns :: KnownExtension

-- | 
--   
- GHC § 7.3.5 Enable a form of guard which matches a pattern
--   and binds variables.
--   
PatternGuards :: KnownExtension

-- | 
--   
- GHC § 7.5.4 Allow a type declared with newtype to
--   use deriving for any class with an instance for the
--   underlying type.
--   
GeneralizedNewtypeDeriving :: KnownExtension

-- | 
--   
- GHC § 9.6.10 Allow use of any typeclass in deriving
--   clauses.
--   
DeriveAnyClass :: KnownExtension

-- | 
--   
- Hugs § 7.1 Enable the "Trex" extensible records
--   system.
--   
ExtensibleRecords :: KnownExtension

-- | 
--   
- Hugs § 7.2 Enable type synonyms which are transparent in
--   some definitions and opaque elsewhere, as a way of implementing
--   abstract datatypes.
--   
RestrictedTypeSynonyms :: KnownExtension

-- | 
--   
- Hugs § 7.3 Enable an alternate syntax for string literals,
--   with string templating.
--   
HereDocuments :: KnownExtension

-- | 
--   
- GHC § 7.3.2 Allow the character # as a postfix
--   modifier on identifiers. Also enables literal syntax for unboxed
--   values.
--   
MagicHash :: KnownExtension

-- | Binary integer literals
BinaryLiterals :: KnownExtension

-- | 
--   
- GHC § 7.7 Allow data types and type synonyms which are
--   indexed by types, i.e. ad-hoc polymorphism for types.
--   
TypeFamilies :: KnownExtension

-- | 
--   
- GHC § 7.5.2 Allow a standalone declaration which invokes
--   the type class deriving mechanism.
--   
StandaloneDeriving :: KnownExtension

-- | 
--   
- GHC § 7.3.1 Allow certain Unicode characters to stand for
--   certain ASCII character sequences, e.g. keywords and punctuation.
--   
UnicodeSyntax :: KnownExtension

-- | 
--   
- GHC § 8.1.1 Allow the use of unboxed types as foreign
--   types, e.g. in foreign import and foreign
--   export.
--   
UnliftedFFITypes :: KnownExtension

-- | 
--   
- GHC § 7.4.3 Defer validity checking of types until after
--   expanding type synonyms, relaxing the constraints on how synonyms may
--   be used.
--   
LiberalTypeSynonyms :: KnownExtension

-- | 
--   
- GHC § 7.4.2 Allow the name of a type constructor, type
--   class, or type variable to be an infix operator.
--   
TypeOperators :: KnownExtension

-- | 
--   
- GHC § 7.26.5 Parallel arrays for Data Parallel
--   Haskell.
--   
ParallelArrays :: KnownExtension

-- | 
--   
- GHC § 7.3.16 Enable syntax for implicitly binding local
--   names corresponding to the field names of a record. A wildcard binds
--   all unmentioned names, unlike NamedFieldPuns.
--   
RecordWildCards :: KnownExtension

-- | Deprecated, use NamedFieldPuns instead.
RecordPuns :: KnownExtension

-- | 
--   
- GHC § 7.3.14 Allow a record field name to be disambiguated
--   by the type of the record it's in.
--   
DisambiguateRecordFields :: KnownExtension

-- | 
--   
- GHC § 7.6.4 Enable overloading of string literals using a
--   type class, much like integer literals.
--   
OverloadedStrings :: KnownExtension

-- | 
--   
- GHC § 7.4.6 Enable generalized algebraic data types, in
--   which type variables may be instantiated on a per-constructor basis.
--   Implies GADTSyntax.
--   
GADTs :: KnownExtension

-- | 
--   
- GHC § 7.17.2 Make pattern bindings monomorphic.
--   
MonoPatBinds :: KnownExtension

-- | 
--   
- GHC § 7.8.8 Relax the requirements on mutually-recursive
--   polymorphic functions.
--   
RelaxedPolyRec :: KnownExtension

-- | 
--   
- GHC § 2.4.5 Allow default instantiation of polymorphic
--   types in more situations.
--   
ExtendedDefaultRules :: KnownExtension

-- | 
--   
- GHC § 7.2.2 Enable unboxed tuples.
--   
UnboxedTuples :: KnownExtension

-- | 
--   
- GHC § 7.5.3 Enable deriving for classes
--   Data.Typeable.Typeable and Data.Generics.Data.
--   
DeriveDataTypeable :: KnownExtension

-- | 
--   
- GHC § 7.6.1.3 Allow a class method's type to place
--   additional constraints on a class type variable.
--   
ConstrainedClassMethods :: KnownExtension

-- | 
--   
- GHC § 7.3.18 Allow imports to be qualified by the package
--   name the module is intended to be imported from, e.g.
--   
--   
--   
--   import "network" Network.Socket
--   
PackageImports :: KnownExtension
LambdaCase :: KnownExtension

-- | 
--   
- GHC § 7.3.20 Allow case expressions with no
--   alternatives.
--   
EmptyCase :: KnownExtension

-- | 
--   
- GHC § 7.8.6 Deprecated in GHC 6.12 and will be removed in
--   GHC 7. Allow a type variable to be instantiated at a polymorphic
--   type.
--   
ImpredicativeTypes :: KnownExtension

-- | 
--   
- GHC § 7.3.3 Change the syntax for qualified infix
--   operators.
--   
NewQualifiedOperators :: KnownExtension

-- | 
--   
- GHC § 7.3.12 Relax the interpretation of left operator
--   sections to allow unary postfix operators.
--   
PostfixOperators :: KnownExtension

-- | 
--   
- GHC § 7.9.5 Enable quasi-quotation, a mechanism for
--   defining new concrete syntax for expressions and patterns.
--   
QuasiQuotes :: KnownExtension

-- | 
--   
- GHC § 7.3.10 Enable generalized list comprehensions,
--   supporting operations such as sorting and grouping.
--   
TransformListComp :: KnownExtension

-- | 
--   
- GHC § 7.3.6 Enable view patterns, which match a value by
--   applying a function and matching on the result.
--   
ViewPatterns :: KnownExtension

-- | Allow concrete XML syntax to be used in expressions and patterns, as
--   per the Haskell Server Pages extension language:
--   http://www.haskell.org/haskellwiki/HSP. The ideas behind it are
--   discussed in the paper "Haskell Server Pages through Dynamic Loading"
--   by Niklas Broberg, from Haskell Workshop '05.
XmlSyntax :: KnownExtension

-- | Allow regular pattern matching over lists, as discussed in the paper
--   "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and
--   Josef Svenningsson, from ICFP '04.
RegularPatterns :: KnownExtension

-- | Enables the use of tuple sections, e.g. (, True) desugars
--   into x -> (x, True).
TupleSections :: KnownExtension

-- | Allows GHC primops, written in C--, to be imported into a Haskell
--   file.
GHCForeignImportPrim :: KnownExtension

-- | Support for patterns of the form n + k, where k is
--   an integer literal.
NPlusKPatterns :: KnownExtension

-- | Improve the layout rule when if expressions are used in a
--   do block.
DoAndIfThenElse :: KnownExtension

-- | Makes much of the Haskell sugar be desugared into calls to the
--   function with a particular name that is in scope.
RebindableSyntax :: KnownExtension

-- | Make forall a keyword in types, which can be used to give the
--   generalisation explicitly.
ExplicitForAll :: KnownExtension

-- | Allow contexts to be put on datatypes, e.g. the Eq a in
--   data Eq a => Set a = NilSet | ConsSet a (Set a).
DatatypeContexts :: KnownExtension

-- | Local (let and where) bindings are monomorphic.
MonoLocalBinds :: KnownExtension

-- | Enable deriving for the Data.Functor.Functor class.
DeriveFunctor :: KnownExtension

-- | 
--   
- GHC § 7.5.3 Enable deriving for the
--   Generic and Generic1 classes.
--   
DeriveGeneric :: KnownExtension

-- | Enable deriving for the Data.Traversable.Traversable
--   class.
DeriveTraversable :: KnownExtension

-- | Enable deriving for the Data.Foldable.Foldable
--   class.
DeriveFoldable :: KnownExtension

-- | Enable non-decreasing indentation for 'do' blocks.
NondecreasingIndentation :: KnownExtension

-- | 
--   
- GHC § 8.1.4 Enable interruptible FFI.
--   
InterruptibleFFI :: KnownExtension

-- | 
--   
- GHC § 8.1.5 Enable the capi calling convention in
--   the foreign function interface.
--   
CApiFFI :: KnownExtension

-- | GHCJS FFI extension with convenient import patterns, asynchronous FFI
--   and a JSVal FFI type
JavaScriptFFI :: KnownExtension

-- | 
--   
- GHC § 7.3.27 Enable explicit namespaces in
--   import/export.
--   
ExplicitNamespaces :: KnownExtension
DataKinds :: KnownExtension
PolyKinds :: KnownExtension

-- | 
--   
- GHC § 7.3.16 Enable the multi-way if-expressions extension
--   to accept conditional expressions with multiple branches.
--   
MultiWayIf :: KnownExtension

-- | 
--   
- GHC § 7.20.3 Allow imports to be qualified with a safe
--   keyword that requires the imported module be trusted as according to
--   the Safe Haskell definition of trust.
--   
--   
--   
--   import safe Network.Socket
--   
SafeImports :: KnownExtension

-- | 
--   
- GHC § 7.20 Compile a module in the Safe, Safe Haskell mode
--   -- a restricted form of the Haskell language to ensure type
--   safety.
--   
Safe :: KnownExtension

-- | 
--   
- GHC § 7.20 Compile a module in the Trustworthy, Safe
--   Haskell mode -- no restrictions apply but the module is marked as
--   trusted as long as the package the module resides in is trusted.
--   
Trustworthy :: KnownExtension

-- | 
--   
- GHC § 7.6.1.4 Allow default signatures in class
--   definitions. They apply to default methods implemented in this
--   class.
--   
DefaultSignatures :: KnownExtension

-- | 
--   
- GHC § 7.40 Allow type classimplicit
--   parameterequality constraints to be used as types with the special
--   kind Constraint. Also generalise the (ctxt => ty) syntax so that
--   any type of kind Constraint can occur before the arrow.
--   
ConstraintKinds :: KnownExtension

-- | 
--   
- GHC § 7.25.3 Allow role annotations.
--   
RoleAnnotations :: KnownExtension

-- | 
--   
- GHC § 7.3.8 Enable giving names to parametrized pattern
--   schemes
--   
PatternSynonyms :: KnownExtension

-- | 
--   
- GHC § 7.15 Allow partial specified type signatures. Note
--   that this extension does not affect parsing. It only affects whether
--   the program is able to be run with partial signatures.
--   
PartialTypeSignatures :: KnownExtension

-- | 
--   
- GHC § 7.15.1.2 This extension treats type variables which
--   start with an underscore as wildcards. For example, `foo :: _x` is
--   equivalent to `foo :: _`.
--   
NamedWildCards :: KnownExtension
TypeApplications :: KnownExtension
TypeFamilyDependencies :: KnownExtension
OverloadedLabels :: KnownExtension

-- | Allow multiple deriving clauses, each optionally qualified
--   with a strategy.
DerivingStrategies :: KnownExtension
UnboxedSums :: KnownExtension

-- | 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

-- | 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

module Data.Derive.DSL.HSE
data Output
OString :: String -> Output
OInt :: Integer -> Output
OApp :: String -> [Output] -> Output
OList :: [Output] -> Output
OIgnore :: Output
OCustom :: String -> Output
type Out = [Decl ()]
type Ctor = CtorDecl
type Input = DataDecl
sample :: Input
outEq :: Out -> Out -> Bool
showOut :: Pretty a => [a] -> String
dataName :: DataDecl -> String
dataVars :: DataDecl -> Int
dataCtors :: DataDecl -> [CtorDecl]
ctorName :: CtorDecl -> String
ctorArity :: CtorDecl -> Integer
ctorIndex :: Input -> Ctor -> Integer
toInput :: DataDecl -> Input
toOutput :: Data a => a -> Output
fromOutput :: Data a => Output -> a
coerce :: (Typeable a1, Typeable a2) => a1 -> a2
readCon :: DataType -> [Char] -> Constr
out :: Data a => a -> Output
fromState :: State a x -> x

-- | Gather the extensions declared in LANGUAGE pragmas at the top of the
--   file. Returns Nothing if the parse of the pragmas fails.
readExtensions :: String -> Maybe (Maybe Language, [Extension])
parseFileContentsWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])

-- | Parse a source file from a string using a custom parse mode.
parseFileContentsWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)

-- | Parse a source file from a string, with an extra set of extensions to
--   know about on top of what the file itself declares.
parseFileContentsWithExts :: [Extension] -> String -> ParseResult (Module SrcSpanInfo)

-- | Parse a source file from a string using the default parse mode.
parseFileContents :: String -> ParseResult (Module SrcSpanInfo)

-- | Parse a source file on disk, supplying a custom parse mode, and
--   retaining comments as well as unknown pragmas.
parseFileWithCommentsAndPragmas :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo, [Comment], [UnknownPragma]))
parseFileWithComments :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo, [Comment]))

-- | Parse a source file on disk, supplying a custom parse mode.
parseFileWithMode :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo))

-- | Parse a source file on disk, with an extra set of extensions to know
--   about on top of what the file itself declares.
parseFileWithExts :: [Extension] -> FilePath -> IO (ParseResult (Module SrcSpanInfo))

-- | Parse a source file on disk, using the default parse mode.
parseFile :: FilePath -> IO (ParseResult (Module SrcSpanInfo))

-- | Apply a constructor of a given name to a list of pattern arguments,
--   forming a constructor pattern.
metaConPat :: String -> [Pat ()] -> Pat ()

-- | Apply function of a given name to a list of arguments.
metaFunction :: String -> [Exp ()] -> Exp ()

-- | Bind an identifier to an expression.
nameBind :: Name () -> Exp () -> Decl ()

-- | A pattern bind where the pattern is a variable, and where there are no
--   guards, but with a 'where' clause.
patBindWhere :: Pat () -> Exp () -> [Decl ()] -> Decl ()

-- | A pattern bind where the pattern is a variable, and where there are no
--   guards and no 'where' clause.
patBind :: Pat () -> Exp () -> Decl ()

-- | A function with a single clause, a single argument, no guards and no
--   where declarations
simpleFun :: Name () -> Name () -> Exp () -> Decl ()

-- | A function with a single clause
sfun :: Name () -> [Name ()] -> Rhs () -> Maybe (Binds ()) -> Decl ()

-- | Generate k names by appending numbers 1 through k to a given string.
genNames :: String -> Int -> [Name ()]

-- | The wildcard pattern: _
wildcard :: Pat ()

-- | An empty binding group.
noBinds :: Maybe (Binds ())

-- | A let binding group as a statement.
letStmt :: [Decl ()] -> Stmt ()

-- | A generator statement: pat <- exp
genStmt :: Pat () -> Exp () -> Stmt ()

-- | A qualifier expression statement.
qualStmt :: Exp () -> Stmt ()

-- | Put parentheses around a pattern.
pParen :: Pat () -> Pat ()

-- | The empty list pattern.
peList :: Pat ()

-- | The empty list expression.
eList :: Exp ()

-- | A list expression.
listE :: [Exp ()] -> Exp ()

-- | An alternative with a single guard in a case expression.
altGW :: Pat () -> [Stmt ()] -> Exp () -> Binds () -> Alt ()

-- | An unguarded alternative in a case expression.
alt :: Pat () -> Exp () -> Alt ()

-- | A case expression.
caseE :: Exp () -> [Alt ()] -> Exp ()

-- | A let ... in block.
letE :: [Decl ()] -> Exp () -> Exp ()

-- | Lambda abstraction, given a list of argument patterns and an
--   expression body.
lamE :: [Pat ()] -> Exp () -> Exp ()

-- | A do block formed by the given statements. The last statement in the
--   list should be a Qualifier expression.
doE :: [Stmt ()] -> Exp ()

-- | A literal integer pattern.
intP :: Integer -> Pat ()

-- | A literal character pattern.
charP :: Char -> Pat ()

-- | A literal string pattern.
strP :: String -> Pat ()

-- | A literal integer expression.
intE :: Integer -> Exp ()

-- | A literal character expression.
charE :: Char -> Exp ()

-- | A literal string expression.
strE :: String -> Exp ()

-- | A function with a given name.
function :: String -> Exp ()

-- | A tuple pattern consisting of variables only.
pvarTuple :: [Name ()] -> Pat ()

-- | A tuple expression consisting of variables only.
varTuple :: [Name ()] -> Exp ()

-- | A tuple pattern.
pTuple :: [Pat ()] -> Pat ()

-- | A tuple expression.
tuple :: [Exp ()] -> Exp ()

-- | A constructor pattern, with argument patterns.
pApp :: Name () -> [Pat ()] -> Pat ()

-- | Apply a function to a list of arguments.
appFun :: Exp () -> [Exp ()] -> Exp ()

-- | Apply an operator infix.
infixApp :: Exp () -> QOp () -> Exp () -> Exp ()

-- | A pattern variable.
pvar :: Name () -> Pat ()

-- | A qualified variable as expression.
qvar :: ModuleName () -> Name () -> Exp ()

-- | Use the given identifier as an operator.
op :: Name () -> QOp ()

-- | A symbol identifier. The string should be a valid Haskell symbol
--   identifier.
sym :: String -> Name ()

-- | An identifier with the given string as its name. The string should be
--   a valid Haskell identifier.
name :: String -> Name ()

-- | Print an AST exactly as specified by the annotations on the nodes in
--   the tree.
exactPrint :: ExactP ast => ast SrcSpanInfo -> [Comment] -> String
class Annotated ast => ExactP (ast :: Type -> Type)
unListOf :: () => ListOf a -> [a]

-- | Non-greedy parse of a string starting with a series of top-level
--   option pragmas.
getTopPragmas :: String -> ParseResult [ModulePragma SrcSpanInfo]

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseImportDeclWithComments :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell type, using an explicit
--   ParseMode.
parseImportDeclWithMode :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo)

-- | Parse of a string containing a Haskell statement, using
--   defaultParseMode.
parseImportDecl :: String -> ParseResult (ImportDecl SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseStmtWithComments :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell type, using an explicit
--   ParseMode.
parseStmtWithMode :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)

-- | Parse of a string containing a Haskell statement, using
--   defaultParseMode.
parseStmt :: String -> ParseResult (Stmt SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseTypeWithComments :: ParseMode -> String -> ParseResult (Type SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell type, using an explicit
--   ParseMode.
parseTypeWithMode :: ParseMode -> String -> ParseResult (Type SrcSpanInfo)

-- | Parse of a string containing a Haskell type, using
--   defaultParseMode.
parseType :: String -> ParseResult (Type SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseDeclWithComments :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell top-level declaration, using an
--   explicit ParseMode.
parseDeclWithMode :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo)

-- | Parse of a string containing a Haskell top-level declaration, using
--   defaultParseMode.
parseDecl :: String -> ParseResult (Decl SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parsePatWithComments :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell pattern, using an explicit
--   ParseMode.
parsePatWithMode :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo)

-- | Parse of a string containing a Haskell pattern, using
--   defaultParseMode.
parsePat :: String -> ParseResult (Pat SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseExpWithComments :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo, [Comment])

-- | Parse of a string containing a Haskell expression, using an explicit
--   ParseMode.
parseExpWithMode :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo)

-- | Parse of a string containing a Haskell expression, using
--   defaultParseMode.
parseExp :: String -> ParseResult (Exp SrcSpanInfo)

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode, retaining comments.
parseModuleWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])

-- | Parse of a string containing a complete Haskell module, using an
--   explicit ParseMode.
parseModuleWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)

-- | Parse of a string, which should contain a complete Haskell module,
--   using defaultParseMode.
parseModule :: String -> ParseResult (Module SrcSpanInfo)

-- | Type intended to be used with Parseable, with instances that
--   implement a non-greedy parse of the module name, including top-level
--   pragmas. This means that a parse error that comes after the module
--   header won't be returned. If the Maybe value is Nothing,
--   then this means that there was no module header.
data PragmasAndModuleName l
PragmasAndModuleName :: l -> [ModulePragma l] -> Maybe (ModuleName l) -> PragmasAndModuleName l
data PragmasAndModuleHead l
PragmasAndModuleHead :: l -> [ModulePragma l] -> Maybe (ModuleHead l) -> PragmasAndModuleHead l
data ModuleHeadAndImports l
ModuleHeadAndImports :: l -> [ModulePragma l] -> Maybe (ModuleHead l) -> [ImportDecl l] -> ModuleHeadAndImports l

-- | Instances of Parseable for NonGreedy a will only
--   consume the input until a is fully parsed. This means that
--   parse errors that come later in the input will be ignored. It's also
--   more efficient, as it's fully lazy in the remainder of the input:
--   
--   
--   >>> parse (unlines ("module A where" : "main =" : repeat "blah")) :: ParseResult PragmasAndModuleHead
--   ParseOk (NonGreedy {unNonGreedy = PragmasAndModuleHead [] (ModuleName "A",Nothing,Nothing)})
--   
--   
--   (this example uses the simplified AST)
newtype NonGreedy a
NonGreedy :: a -> NonGreedy a
[unNonGreedy] :: NonGreedy a -> a

-- | ListOf a stores lists of the AST type a, along with
--   a SrcSpanInfo, in order to provide Parseable instances
--   for lists. These instances are provided when the type is used as a
--   list in the syntax, and the same delimiters are used in all of its
--   usages. Some exceptions are made:
data ListOf a
ListOf :: SrcSpanInfo -> [a] -> ListOf a

-- | Lex a string into a list of Haskell source tokens, using an explicit
--   mode.
lexTokenStreamWithMode :: ParseMode -> String -> ParseResult [Loc Token]

-- | Lex a string into a list of Haskell 2010 source tokens.
lexTokenStream :: String -> ParseResult [Loc Token]
data Token
VarId :: String -> Token
LabelVarId :: String -> Token
QVarId :: (String, String) -> Token
IDupVarId :: String -> Token
ILinVarId :: String -> Token
ConId :: String -> Token
QConId :: (String, String) -> Token
DVarId :: [String] -> Token
VarSym :: String -> Token
ConSym :: String -> Token
QVarSym :: (String, String) -> Token
QConSym :: (String, String) -> Token
IntTok :: (Integer, String) -> Token
FloatTok :: (Rational, String) -> Token
Character :: (Char, String) -> Token
StringTok :: (String, String) -> Token
IntTokHash :: (Integer, String) -> Token
WordTokHash :: (Integer, String) -> Token
FloatTokHash :: (Rational, String) -> Token
DoubleTokHash :: (Rational, String) -> Token
CharacterHash :: (Char, String) -> Token
StringHash :: (String, String) -> Token
LeftParen :: Token
RightParen :: Token
LeftHashParen :: Token
RightHashParen :: Token
SemiColon :: Token
LeftCurly :: Token
RightCurly :: Token
VRightCurly :: Token
LeftSquare :: Token
RightSquare :: Token
ParArrayLeftSquare :: Token
ParArrayRightSquare :: Token
Comma :: Token
Underscore :: Token
BackQuote :: Token
Dot :: Token
DotDot :: Token
Colon :: Token
QuoteColon :: Token
DoubleColon :: Token
Equals :: Token
Backslash :: Token
Bar :: Token
LeftArrow :: Token
RightArrow :: Token
At :: Token
TApp :: Token
Tilde :: Token
DoubleArrow :: Token
Minus :: Token
Exclamation :: Token
Star :: Token
LeftArrowTail :: Token
RightArrowTail :: Token
LeftDblArrowTail :: Token
RightDblArrowTail :: Token
THExpQuote :: Token
THPatQuote :: Token
THDecQuote :: Token
THTypQuote :: Token
THCloseQuote :: Token

-- | ]
THIdEscape :: String -> Token
THParenEscape :: Token
THVarQuote :: Token
THTyQuote :: Token
THQuasiQuote :: (String, String) -> Token
RPGuardOpen :: Token
RPGuardClose :: Token

-- | )
RPCAt :: Token
XCodeTagOpen :: Token
XCodeTagClose :: Token
XStdTagOpen :: Token
XStdTagClose :: Token
XCloseTagOpen :: Token
XEmptyTagClose :: Token
XChildTagOpen :: Token
XPCDATA :: String -> Token
XRPatOpen :: Token
XRPatClose :: Token
PragmaEnd :: Token
RULES :: Token
INLINE :: Bool -> Token
INLINE_CONLIKE :: Token
SPECIALISE :: Token
SPECIALISE_INLINE :: Bool -> Token
SOURCE :: Token
DEPRECATED :: Token
WARNING :: Token
SCC :: Token
GENERATED :: Token
CORE :: Token
UNPACK :: Token
NOUNPACK :: Token
OPTIONS :: (Maybe String, String) -> Token
LANGUAGE :: Token
ANN :: Token
MINIMAL :: Token
NO_OVERLAP :: Token
OVERLAP :: Token
OVERLAPPING :: Token
OVERLAPPABLE :: Token
OVERLAPS :: Token
INCOHERENT :: Token
COMPLETE :: Token
KW_As :: Token
KW_By :: Token
KW_Case :: Token
KW_Class :: Token
KW_Data :: Token
KW_Default :: Token
KW_Deriving :: Token
KW_Do :: Token
KW_MDo :: Token
KW_Else :: Token
KW_Family :: Token
KW_Forall :: Token
KW_Group :: Token
KW_Hiding :: 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_Proc :: Token
KW_Rec :: Token
KW_Role :: Token
KW_Then :: Token
KW_Type :: Token
KW_Using :: Token
KW_Where :: Token
KW_Qualified :: Token
KW_Pattern :: Token
KW_Stock :: Token
KW_Anyclass :: Token
KW_Foreign :: Token
KW_Export :: Token
KW_Safe :: Token
KW_Unsafe :: Token
KW_Threadsafe :: Token
KW_Interruptible :: Token
KW_StdCall :: Token
KW_CCall :: Token
KW_CPlusPlus :: Token
KW_DotNet :: Token
KW_Jvm :: Token
KW_Js :: Token
KW_JavaScript :: Token
KW_CApi :: Token
EOF :: Token

-- | Default parameters for a parse. The default is an unknown filename, no
--   extensions (i.e. Haskell 98), don't ignore LANGUAGE pragmas, do ignore
--   LINE pragmas, and be aware of fixities from the Prelude.
defaultParseMode :: ParseMode

-- | Retrieve the result of a successful parse, throwing an error if the
--   parse is actually not successful.
fromParseResult :: () => ParseResult a -> a

-- | Class providing function for parsing at many different types.
--   
--   Note that for convenience of implementation, the default methods have
--   definitions equivalent to undefined. The minimal definition is
--   all of the visible methods.
class Parseable ast

-- | Parse a string with default mode.
parse :: Parseable ast => String -> ParseResult ast

-- | Parse a string with an explicit ParseMode.
parseWithMode :: Parseable ast => ParseMode -> String -> ParseResult ast

-- | Parse a string with an explicit ParseMode, returning all
--   comments along with the AST.
parseWithComments :: Parseable ast => ParseMode -> String -> ParseResult (ast, [Comment])

-- | 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

-- | Static parameters governing a parse. Note that the various parse
--   functions in Language.Haskell.Exts.Parser never look at
--   LANGUAGE pragmas, regardless of what the
--   ignoreLanguagePragmas flag is set to. Only the various
--   parseFile functions in Language.Haskell.Exts will act
--   on it, when set to False.
data ParseMode
ParseMode :: String -> Language -> [Extension] -> Bool -> Bool -> Maybe [Fixity] -> Bool -> ParseMode

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

-- | base language (e.g. Haskell98, Haskell2010)
[baseLanguage] :: ParseMode -> Language

-- | list of extensions enabled for parsing
[extensions] :: ParseMode -> [Extension]

-- | if True, the parser won't care about further extensions in
--   LANGUAGE pragmas in source files
[ignoreLanguagePragmas] :: ParseMode -> Bool

-- | if True, the parser won't read line position information from
--   LINE pragmas in source files
[ignoreLinePragmas] :: ParseMode -> Bool

-- | list of fixities to be aware of
[fixities] :: ParseMode -> Maybe [Fixity]

-- | Checks whether functions have a consistent arity
[ignoreFunctionArity] :: ParseMode -> Bool

-- | Associates an AST with Source Span Information with relevant Haddock
--   comments
associateHaddock :: (Annotated ast, Traversable ast) => (ast SrcSpanInfo, [Comment]) -> ast (SrcSpanInfo, [Comment])

-- | A Haskell comment. The Bool is True if the comment is
--   multi-line, i.e. {- -}.
data Comment
Comment :: Bool -> SrcSpan -> String -> Comment

-- | An unknown pragma.
data UnknownPragma
UnknownPragma :: SrcSpan -> String -> UnknownPragma
infix_ :: Int -> [String] -> [Fixity]
infixl_ :: Int -> [String] -> [Fixity]
infixr_ :: Int -> [String] -> [Fixity]

-- | All fixities defined in the base package.
--   
--   Note that the +++ operator appears in both Control.Arrows and
--   Text.ParserCombinators.ReadP. The listed precedence for +++
--   in this list is that of Control.Arrows.
baseFixities :: [Fixity]

-- | All fixities defined in the Prelude.
preludeFixities :: [Fixity]

-- | Operator fixities are represented by their associativity (left, right
--   or none) and their precedence (0-9).
data Fixity
Fixity :: Assoc () -> Int -> QName () -> Fixity

-- | All AST elements that may include expressions which in turn may need
--   fixity tweaking will be instances of this class.
class AppFixity (ast :: Type -> Type)

-- | Tweak any expressions in the element to account for the fixities
--   given. Assumes that all operator expressions are fully left
--   associative chains to begin with.
applyFixities :: (AppFixity ast, Monad m) => [Fixity] -> ast SrcSpanInfo -> m (ast SrcSpanInfo)

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

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

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

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

-- | render the document with a given mode. renderWithMode :: PPHsMode
--   -> Doc -> String renderWithMode = renderStyleMode P.style
--   
--   render the document with defaultMode. render :: Doc ->
--   String render = renderWithMode defaultMode
--   
--   pretty-print with a given style and mode.
prettyPrintStyleMode :: Pretty a => Style -> PPHsMode -> a -> String

-- | The default mode: pretty-print using the offside rule and sensible
--   defaults.
defaultMode :: PPHsMode

-- | 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
type Indent = Int

-- | Pretty-printing parameters.
--   
--   Note: the onsideIndent must be positive and less than
--   all other indents.
data PPHsMode
PPHsMode :: Indent -> Indent -> Indent -> Indent -> Indent -> Indent -> Indent -> Bool -> PPLayout -> 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
[multiIfIndent] :: PPHsMode -> Indent

-- | indentation of the body of a multi-if 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

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

-- | Test if two AST elements are equal modulo annotations.
(=~=) :: (Annotated a, Eq (a ())) => a l1 -> a l2 -> Bool
tuple_tycon :: () => l -> Boxed -> Int -> Type l
unboxed_singleton_tycon :: () => l -> Type l
list_tycon :: () => l -> Type l
fun_tycon :: () => l -> Type l
unit_tycon :: () => l -> Type l
tuple_tycon_name :: () => l -> Boxed -> Int -> QName l
unboxed_singleton_tycon_name :: () => l -> QName l
list_tycon_name :: () => l -> QName l
fun_tycon_name :: () => l -> QName l
unit_tycon_name :: () => l -> QName l
anyclass_name :: () => l -> Name l
stock_name :: () => l -> Name l
role_name :: () => l -> Name l
family_name :: () => l -> Name l
forall_name :: () => l -> Name l
capi_name :: () => l -> Name l
javascript_name :: () => l -> Name l
js_name :: () => l -> Name l
jvm_name :: () => l -> Name l
dotnet_name :: () => l -> Name l
cplusplus_name :: () => l -> Name l
ccall_name :: () => l -> Name l
stdcall_name :: () => l -> Name l
threadsafe_name :: () => l -> Name l
interruptible_name :: () => l -> Name l
unsafe_name :: () => l -> Name l
safe_name :: () => l -> Name l
export_name :: () => l -> Name l
hole_name :: () => l -> QName l
star_name :: () => l -> Name l
dot_name :: () => l -> Name l
bang_name :: () => l -> Name l
minus_name :: () => l -> Name l
hiding_name :: () => l -> Name l
qualified_name :: () => l -> Name l
as_name :: () => l -> Name l
unboxed_singleton_con :: () => l -> Exp l
tuple_con :: () => l -> Boxed -> Int -> Exp l
unit_con :: () => l -> Exp l
unboxed_singleton_con_name :: () => l -> QName l
list_cons_name :: () => l -> QName l
tuple_con_name :: () => l -> Boxed -> Int -> QName l
unit_con_name :: () => l -> QName l
main_name :: () => l -> Name l
main_mod :: () => l -> ModuleName l
prelude_mod :: () => l -> ModuleName l

-- | The name of a Haskell module.
data ModuleName l
ModuleName :: l -> String -> ModuleName l

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

-- | unit type and data constructor ()
UnitCon :: l -> SpecialCon l

-- | list type constructor []
ListCon :: l -> SpecialCon l

-- | function type constructor ->
FunCon :: l -> SpecialCon l

-- | n-ary tuple type and data constructors (,) etc,
--   possibly boxed (#,#)
TupleCon :: l -> Boxed -> Int -> SpecialCon l

-- | list data constructor (:)
Cons :: l -> SpecialCon l

-- | unboxed singleton tuple constructor (# #)
UnboxedSingleCon :: l -> SpecialCon l

-- | An expression hole _
ExprHole :: l -> SpecialCon l

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

-- | name qualified with a module name
Qual :: l -> ModuleName l -> Name l -> QName l

-- | unqualified local name
UnQual :: l -> Name l -> QName l

-- | built-in constructor with special syntax
Special :: l -> SpecialCon l -> QName l

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

-- | varid or conid.
Ident :: l -> String -> Name l

-- | varsym or consym
Symbol :: l -> String -> Name l

-- | An implicit parameter name.
data IPName l

-- | ?ident, non-linear implicit parameter
IPDup :: l -> String -> IPName l

-- | %ident, linear implicit parameter
IPLin :: l -> String -> IPName l

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

-- | variable operator (qvarop)
QVarOp :: l -> QName l -> QOp l

-- | constructor operator (qconop)
QConOp :: l -> QName l -> QOp l

-- | Operators appearing in infix declarations are never
--   qualified.
data Op l

-- | variable operator (varop)
VarOp :: l -> Name l -> Op l

-- | constructor operator (conop)
ConOp :: l -> Name l -> Op l

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

-- | name of a method or field
VarName :: l -> Name l -> CName l

-- | name of a data constructor
ConName :: l -> Name l -> CName l

-- | A complete Haskell source module.
data Module l

-- | an ordinary Haskell module
Module :: l -> Maybe (ModuleHead l) -> [ModulePragma l] -> [ImportDecl l] -> [Decl l] -> Module l

-- | a module consisting of a single XML document. The ModuleName never
--   appears in the source but is needed for semantic purposes, it will be
--   the same as the file name.
XmlPage :: l -> ModuleName l -> [ModulePragma l] -> XName l -> [XAttr l] -> Maybe (Exp l) -> [Exp l] -> Module l

-- | a hybrid module combining an XML document with an ordinary module
XmlHybrid :: l -> Maybe (ModuleHead l) -> [ModulePragma l] -> [ImportDecl l] -> [Decl l] -> XName l -> [XAttr l] -> Maybe (Exp l) -> [Exp l] -> Module l

-- | The head of a module, including the name and export specification.
data ModuleHead l
ModuleHead :: l -> ModuleName l -> Maybe (WarningText l) -> Maybe (ExportSpecList l) -> ModuleHead l

-- | An explicit export specification.
data ExportSpecList l
ExportSpecList :: l -> [ExportSpec l] -> ExportSpecList l

-- | An item in a module's export specification.
data ExportSpec l

-- | variable.
EVar :: l -> QName l -> ExportSpec l

-- | T: a class or datatype exported abstractly, or a type
--   synonym.
EAbs :: l -> Namespace l -> QName l -> ExportSpec l

-- | T(C_1,...,C_n): a class exported with some of its methods, or
--   a datatype exported with some of its constructors.
EThingWith :: l -> EWildcard l -> QName l -> [CName l] -> ExportSpec l

-- | module M: re-export a module.
EModuleContents :: l -> ModuleName l -> ExportSpec l

-- | Indicates the position of the wildcard in an export list
data EWildcard l
NoWildcard :: l -> EWildcard l
EWildcard :: l -> Int -> EWildcard l

-- | Namespaces for imports/exports.
data Namespace l
NoNamespace :: l -> Namespace l
TypeNamespace :: l -> Namespace l
PatternNamespace :: l -> Namespace l

-- | An import declaration.
data ImportDecl l
ImportDecl :: l -> ModuleName l -> Bool -> Bool -> Bool -> Maybe String -> Maybe (ModuleName l) -> Maybe (ImportSpecList l) -> ImportDecl l

-- | annotation, used by parser for position of the import
--   keyword.
[importAnn] :: ImportDecl l -> l

-- | name of the module imported.
[importModule] :: ImportDecl l -> ModuleName l

-- | imported qualified?
[importQualified] :: ImportDecl l -> Bool

-- | imported with {-# SOURCE #-}?
[importSrc] :: ImportDecl l -> Bool

-- | Import safe?
[importSafe] :: ImportDecl l -> Bool

-- | imported with explicit package name
[importPkg] :: ImportDecl l -> Maybe String

-- | optional alias name in an as clause.
[importAs] :: ImportDecl l -> Maybe (ModuleName l)

-- | optional list of import specifications.
[importSpecs] :: ImportDecl l -> Maybe (ImportSpecList l)

-- | An explicit import specification list.
data ImportSpecList l
ImportSpecList :: l -> Bool -> [ImportSpec l] -> ImportSpecList l

-- | An import specification, representing a single explicit item imported
--   (or hidden) from a module.
data ImportSpec l

-- | variable
IVar :: l -> Name l -> ImportSpec l

-- | T: the name of a class, datatype or type synonym.
IAbs :: l -> Namespace l -> Name l -> ImportSpec l

-- | T(..): a class imported with all of its methods, or a
--   datatype imported with all of its constructors.
IThingAll :: l -> Name l -> ImportSpec l

-- | T(C_1,...,C_n): a class imported with some of its methods, or
--   a datatype imported with some of its constructors.
IThingWith :: l -> Name l -> [CName l] -> ImportSpec l

-- | Associativity of an operator.
data Assoc l

-- | non-associative operator (declared with infix)
AssocNone :: l -> Assoc l

-- | left-associative operator (declared with infixl).
AssocLeft :: l -> Assoc l

-- | right-associative operator (declared with infixr)
AssocRight :: l -> Assoc l

-- | A top-level declaration.
data Decl l

-- | A type declaration
TypeDecl :: l -> DeclHead l -> Type l -> Decl l

-- | A type family declaration
TypeFamDecl :: l -> DeclHead l -> Maybe (ResultSig l) -> Maybe (InjectivityInfo l) -> Decl l

-- | A closed type family declaration
ClosedTypeFamDecl :: l -> DeclHead l -> Maybe (ResultSig l) -> Maybe (InjectivityInfo l) -> [TypeEqn l] -> Decl l

-- | A data OR newtype declaration
DataDecl :: l -> DataOrNew l -> Maybe (Context l) -> DeclHead l -> [QualConDecl l] -> [Deriving l] -> Decl l

-- | A data OR newtype declaration, GADT style
GDataDecl :: l -> DataOrNew l -> Maybe (Context l) -> DeclHead l -> Maybe (Kind l) -> [GadtDecl l] -> [Deriving l] -> Decl l

-- | A data family declaration
DataFamDecl :: l -> Maybe (Context l) -> DeclHead l -> Maybe (ResultSig l) -> Decl l

-- | A type family instance declaration
TypeInsDecl :: l -> Type l -> Type l -> Decl l

-- | A data family instance declaration
DataInsDecl :: l -> DataOrNew l -> Type l -> [QualConDecl l] -> [Deriving l] -> Decl l

-- | A data family instance declaration, GADT style
GDataInsDecl :: l -> DataOrNew l -> Type l -> Maybe (Kind l) -> [GadtDecl l] -> [Deriving l] -> Decl l

-- | A declaration of a type class
ClassDecl :: l -> Maybe (Context l) -> DeclHead l -> [FunDep l] -> Maybe [ClassDecl l] -> Decl l

-- | An declaration of a type class instance
InstDecl :: l -> Maybe (Overlap l) -> InstRule l -> Maybe [InstDecl l] -> Decl l

-- | A standalone deriving declaration
DerivDecl :: l -> Maybe (DerivStrategy l) -> Maybe (Overlap l) -> InstRule l -> Decl l

-- | A declaration of operator fixity
InfixDecl :: l -> Assoc l -> Maybe Int -> [Op l] -> Decl l

-- | A declaration of default types
DefaultDecl :: l -> [Type l] -> Decl l

-- | A Template Haskell splicing declaration
SpliceDecl :: l -> Exp l -> Decl l

-- | A type signature declaration
TypeSig :: l -> [Name l] -> Type l -> Decl l

-- | A pattern synonym signature declation
PatSynSig :: l -> [Name l] -> Maybe [TyVarBind l] -> Maybe (Context l) -> Maybe (Context l) -> Type l -> Decl l

-- | A set of function binding clauses
FunBind :: l -> [Match l] -> Decl l

-- | A pattern binding
PatBind :: l -> Pat l -> Rhs l -> Maybe (Binds l) -> Decl l

-- | A pattern synonym binding
PatSyn :: l -> Pat l -> Pat l -> PatternSynDirection l -> Decl l

-- | A foreign import declaration
ForImp :: l -> CallConv l -> Maybe (Safety l) -> Maybe String -> Name l -> Type l -> Decl l

-- | A foreign export declaration
ForExp :: l -> CallConv l -> Maybe String -> Name l -> Type l -> Decl l

-- | A RULES pragma
RulePragmaDecl :: l -> [Rule l] -> Decl l

-- | A DEPRECATED pragma
DeprPragmaDecl :: l -> [([Name l], String)] -> Decl l

-- | A WARNING pragma
WarnPragmaDecl :: l -> [([Name l], String)] -> Decl l

-- | An INLINE pragma
InlineSig :: l -> Bool -> Maybe (Activation l) -> QName l -> Decl l

-- | An INLINE CONLIKE pragma
InlineConlikeSig :: l -> Maybe (Activation l) -> QName l -> Decl l

-- | A SPECIALISE pragma
SpecSig :: l -> Maybe (Activation l) -> QName l -> [Type l] -> Decl l

-- | A SPECIALISE INLINE pragma
SpecInlineSig :: l -> Bool -> Maybe (Activation l) -> QName l -> [Type l] -> Decl l

-- | A SPECIALISE instance pragma
InstSig :: l -> InstRule l -> Decl l

-- | An ANN pragma
AnnPragma :: l -> Annotation l -> Decl l

-- | A MINIMAL pragma
MinimalPragma :: l -> Maybe (BooleanFormula l) -> Decl l

-- | A role annotation
RoleAnnotDecl :: l -> QName l -> [Role l] -> Decl l

-- | A COMPLETE pragma
CompletePragma :: l -> [Name l] -> Maybe (QName l) -> Decl l
data PatternSynDirection l

-- | A unidirectional pattern synonym with "<-"
Unidirectional :: PatternSynDirection l

-- | A bidirectional pattern synonym with "="
ImplicitBidirectional :: PatternSynDirection l

-- | A birectional pattern synonym with the construction specified.
ExplicitBidirectional :: l -> [Decl l] -> PatternSynDirection l

-- | A type equation as found in closed type families.
data TypeEqn l
TypeEqn :: l -> Type l -> Type l -> TypeEqn l

-- | An annotation through an ANN pragma.
data Annotation l

-- | An annotation for a declared name.
Ann :: l -> Name l -> Exp l -> Annotation l

-- | An annotation for a declared type.
TypeAnn :: l -> Name l -> Exp l -> Annotation l

-- | An annotation for the defining module.
ModuleAnn :: l -> Exp l -> Annotation l

-- | A boolean formula for MINIMAL pragmas.
data BooleanFormula l

-- | A variable.
VarFormula :: l -> Name l -> BooleanFormula l

-- | And boolean formulas.
AndFormula :: l -> [BooleanFormula l] -> BooleanFormula l

-- | Or boolean formulas.
OrFormula :: l -> [BooleanFormula l] -> BooleanFormula l

-- | Parenthesized boolean formulas.
ParenFormula :: l -> BooleanFormula l -> BooleanFormula l
data Role l
Nominal :: l -> Role l
Representational :: l -> Role l
Phantom :: l -> Role l
RoleWildcard :: l -> Role l

-- | A flag stating whether a declaration is a data or newtype declaration.
data DataOrNew l
DataType :: l -> DataOrNew l
NewType :: l -> DataOrNew l

-- | Injectivity info for injective type families
data InjectivityInfo l
InjectivityInfo :: l -> Name l -> [Name l] -> InjectivityInfo l
data ResultSig l
KindSig :: l -> Kind l -> ResultSig l
TyVarSig :: l -> TyVarBind l -> ResultSig l

-- | The head of a type or class declaration, which consists of the type or
--   class name applied to some type variables
--   
--   class C a b is represented as
--   
--   
--   DHApp
--      ()
--      (DHApp
--         () (DHead () (Ident () "C")) (UnkindedVar () (Ident () "a")))
--      (UnkindedVar () (Ident () "b"))
--   
--   
--   (where the annotation type l is instantiated with
--   ())
--   
--   class (a :< b) c is represented as
--   
--   
--   DHApp
--      ()
--      (DHParen
--         ()
--         (DHApp
--            ()
--            (DHInfix () (UnkindedVar () (Ident () "a")) (Symbol () ":<"))
--            (UnkindedVar () (Ident () "b"))))
--      (UnkindedVar () (Ident () "c"))
--   
data DeclHead l

-- | type or class name
DHead :: l -> Name l -> DeclHead l

-- | infix application of the type/class name to the left operand
DHInfix :: l -> TyVarBind l -> Name l -> DeclHead l

-- | parenthesized declaration head
DHParen :: l -> DeclHead l -> DeclHead l

-- | application to one more type variable
DHApp :: l -> DeclHead l -> TyVarBind l -> DeclHead l

-- | The instance declaration rule, which is, roughly, the part of the
--   instance declaration before the where keyword.
--   
--   Example: instance Ord a => Ord (Maybe a) is represented as
--   
--   
--   IRule
--      ()
--      Nothing
--      (Just
--         (CxSingle
--            ()
--            (ClassA
--               () (UnQual () (Ident () "Ord")) [ TyVar () (Ident () "a") ])))
--      (IHApp
--         ()
--         (IHCon () (UnQual () (Ident () "Ord")))
--         (TyParen
--            ()
--            (TyApp
--               ()
--               (TyCon () (UnQual () (Ident () "Maybe")))
--               (TyVar () (Ident () "a")))))
--   
--   
--   An optional explicit forall after instance is supported:
--   instance forall a . Ord a => Ord (Maybe a) where becomes
--   
--   
--   IRule
--      ()
--      (Just [ UnkindedVar () (Ident () "a") ])
--      ...
--   
data InstRule l
IRule :: l -> Maybe [TyVarBind l] -> Maybe (Context l) -> InstHead l -> InstRule l
IParen :: l -> InstRule l -> InstRule l

-- | The instance head. The split between rule/head allow us to represent
--   instance (Bounded a => Bounded [a]) where faithfully.
--   
--   The structure of InstHead follows one of DeclHead.
--   
--   For example, instance C (Maybe a) Int where is represented as
--   
--   
--   IHApp
--      ()
--      (IHApp
--         ()
--         (IHCon () (UnQual () (Ident () "C")))
--         (TyParen
--            ()
--            (TyApp
--               ()
--               (TyCon () (UnQual () (Ident () "Maybe")))
--               (TyVar () (Ident () "a")))))
--      (TyCon () (UnQual () (Ident () "Int")))))
--   
data InstHead l

-- | type or class name
IHCon :: l -> QName l -> InstHead l

-- | infix application of the type/class name to the left operand
IHInfix :: l -> Type l -> QName l -> InstHead l

-- | parenthesized instance head
IHParen :: l -> InstHead l -> InstHead l

-- | application to one more type
IHApp :: l -> InstHead l -> Type l -> InstHead l

-- | A deriving clause following a data type declaration.
data Deriving l
Deriving :: l -> Maybe (DerivStrategy l) -> [InstRule l] -> Deriving l

-- | Which technique the user explicitly requested when deriving an
--   instance.
data DerivStrategy l

-- | GHC's "standard" strategy, which is to implement a custom instance for
--   the data type. This only works for certain types that GHC knows about
--   (e.g., Eq, Show, Functor when
--   -XDeriveFunctor is enabled, etc.)
DerivStock :: l -> DerivStrategy l

-- | 
--   -XDeriveAnyClass
--   
DerivAnyclass :: l -> DerivStrategy l

-- | 
--   -XGeneralizedNewtypeDeriving
--   
DerivNewtype :: l -> DerivStrategy l

-- | A binding group inside a let or where clause.
data Binds l

-- | An ordinary binding group
BDecls :: l -> [Decl l] -> Binds l

-- | A binding group for implicit parameters
IPBinds :: l -> [IPBind l] -> Binds l

-- | A binding of an implicit parameter.
data IPBind l
IPBind :: l -> IPName l -> Exp l -> IPBind l

-- | Clauses of a function binding.
data Match l

-- | A clause defined with prefix notation, i.e. the function name followed
--   by its argument patterns, the right-hand side and an optional where
--   clause.
Match :: l -> Name l -> [Pat l] -> Rhs l -> Maybe (Binds l) -> Match l

-- | A clause defined with infix notation, i.e. first its first argument
--   pattern, then the function name, then its following argument(s), the
--   right-hand side and an optional where clause. Note that there can be
--   more than two arguments to a function declared infix, hence the list
--   of pattern arguments.
InfixMatch :: l -> Pat l -> Name l -> [Pat l] -> Rhs l -> Maybe (Binds l) -> Match l

-- | A single constructor declaration within a data type declaration, which
--   may have an existential quantification binding.
data QualConDecl l
QualConDecl :: l -> Maybe [TyVarBind l] -> Maybe (Context l) -> ConDecl l -> QualConDecl l

-- | Declaration of an ordinary data constructor.
data ConDecl l

-- | ordinary data constructor
ConDecl :: l -> Name l -> [Type l] -> ConDecl l

-- | infix data constructor
InfixConDecl :: l -> Type l -> Name l -> Type l -> ConDecl l

-- | record constructor
RecDecl :: l -> Name l -> [FieldDecl l] -> ConDecl l

-- | A single constructor declaration in a GADT data type declaration.
--   
--   If the GADT is declared using the record syntax, e.g.
--   
--   
--   data Ty where
--     TCon :: { field1 :: Int, field2 :: Bool } -> Ty
--   
--   
--   then the fields are stored as a list of FieldDecls, and the
--   final type (Ty in the above example) is stored in the last
--   Type field.
--   
--   If the GADT is declared using the ordinary syntax, e.g.
--   
--   
--   data Ty where
--     TCon :: Int -> Bool -> Ty
--   
--   
--   then Maybe [FieldDecl l] is Nothing, and
--   the whole constructor's type (such as Int -> Bool ->
--   Ty) is stored in the last Type field.
data GadtDecl l
GadtDecl :: l -> Name l -> Maybe [FieldDecl l] -> Type l -> GadtDecl l

-- | Declarations inside a class declaration.
data ClassDecl l

-- | ordinary declaration
ClsDecl :: l -> Decl l -> ClassDecl l

-- | declaration of an associated data type
ClsDataFam :: l -> Maybe (Context l) -> DeclHead l -> Maybe (ResultSig l) -> ClassDecl l

-- | declaration of an associated type synonym
ClsTyFam :: l -> DeclHead l -> Maybe (ResultSig l) -> Maybe (InjectivityInfo l) -> ClassDecl l

-- | default choice for an associated type synonym
ClsTyDef :: l -> TypeEqn l -> ClassDecl l

-- | default signature
ClsDefSig :: l -> Name l -> Type l -> ClassDecl l

-- | Declarations inside an instance declaration.
data InstDecl l

-- | ordinary declaration
InsDecl :: l -> Decl l -> InstDecl l

-- | an associated type definition
InsType :: l -> Type l -> Type l -> InstDecl l

-- | an associated data type implementation
InsData :: l -> DataOrNew l -> Type l -> [QualConDecl l] -> [Deriving l] -> InstDecl l

-- | an associated data type implemented using GADT style
InsGData :: l -> DataOrNew l -> Type l -> Maybe (Kind l) -> [GadtDecl l] -> [Deriving l] -> InstDecl l

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

-- | strict component, marked with "!"
BangedTy :: l -> BangType l

-- | lazy component, marked with "~"
LazyTy :: l -> BangType l

-- | No strictness information
NoStrictAnnot :: l -> BangType l
data Unpackedness l

-- | "{-# UNPACK #-}"
Unpack :: l -> Unpackedness l

-- | "{-# NOUNPACK #-}"
NoUnpack :: l -> Unpackedness l

-- | No unpack pragma
NoUnpackPragma :: l -> Unpackedness l

-- | The right hand side of a function binding, pattern binding, or a case
--   alternative.
data Rhs l

-- | unguarded right hand side (exp)
UnGuardedRhs :: l -> Exp l -> Rhs l

-- | guarded right hand side (gdrhs)
GuardedRhss :: l -> [GuardedRhs l] -> Rhs l

-- | A guarded right hand side | stmts =
--   exp, or | stmts -> exp for
--   case alternatives. The guard is a series of statements when using
--   pattern guards, otherwise it will be a single qualifier expression.
data GuardedRhs l
GuardedRhs :: l -> [Stmt l] -> Exp l -> GuardedRhs l

-- | A type qualified with a context. An unqualified type has an empty
--   context.
data Type l

-- | qualified type
TyForall :: l -> Maybe [TyVarBind l] -> Maybe (Context l) -> Type l -> Type l

-- | function type
TyFun :: l -> Type l -> Type l -> Type l

-- | tuple type, possibly boxed
TyTuple :: l -> Boxed -> [Type l] -> Type l

-- | unboxed tuple type
TyUnboxedSum :: l -> [Type l] -> Type l

-- | list syntax, e.g. [a], as opposed to [] a
TyList :: l -> Type l -> Type l

-- | parallel array syntax, e.g. [:a:]
TyParArray :: l -> Type l -> Type l

-- | application of a type constructor
TyApp :: l -> Type l -> Type l -> Type l

-- | type variable
TyVar :: l -> Name l -> Type l

-- | named type or type constructor
TyCon :: l -> QName l -> Type l

-- | type surrounded by parentheses
TyParen :: l -> Type l -> Type l

-- | infix type constructor
TyInfix :: l -> Type l -> MaybePromotedName l -> Type l -> Type l

-- | type with explicit kind signature
TyKind :: l -> Type l -> Kind l -> Type l

-- | 'K, a promoted data type (-XDataKinds).
TyPromoted :: l -> Promoted l -> Type l

-- | type equality predicate enabled by ConstraintKinds
TyEquals :: l -> Type l -> Type l -> Type l

-- | template haskell splice type
TySplice :: l -> Splice l -> Type l

-- | Strict type marked with "!" or type marked with UNPACK
--   pragma.
TyBang :: l -> BangType l -> Unpackedness l -> Type l -> Type l

-- | Either an anonymous of named type wildcard
TyWildCard :: l -> Maybe (Name l) -> Type l

-- | 
--   [$name| string |]
--   
TyQuasiQuote :: l -> String -> String -> Type l
data MaybePromotedName l
PromotedName :: l -> QName l -> MaybePromotedName l
UnpromotedName :: l -> QName l -> MaybePromotedName l

-- | Bools here are True if there was a leading quote which may be left
--   out. For example '[k1,k2] means the same thing as
--   [k1,k2].
data Promoted l

-- | parsed value and raw string
PromotedInteger :: l -> Integer -> String -> Promoted l

-- | parsed value and raw string
PromotedString :: l -> String -> String -> Promoted l
PromotedCon :: l -> Bool -> QName l -> Promoted l
PromotedList :: l -> Bool -> [Type l] -> Promoted l
PromotedTuple :: l -> [Type l] -> Promoted l
PromotedUnit :: l -> Promoted l

-- | Flag denoting whether a tuple is boxed or unboxed.
data Boxed
Boxed :: Boxed
Unboxed :: Boxed

-- | A type variable declaration, optionally with an explicit kind
--   annotation.
data TyVarBind l

-- | variable binding with kind annotation
KindedVar :: l -> Name l -> Kind l -> TyVarBind l

-- | ordinary variable binding
UnkindedVar :: l -> Name l -> TyVarBind l

-- | An explicit kind annotation.
data Kind l

-- | *, the kind of types
KindStar :: l -> Kind l

-- | ->, the kind of a type constructor
KindFn :: l -> Kind l -> Kind l -> Kind l

-- | a parenthesised kind
KindParen :: l -> Kind l -> Kind l

-- | k, a kind variable (-XPolyKinds)
KindVar :: l -> QName l -> Kind l

-- | 
--   k1 k2
--   
KindApp :: l -> Kind l -> Kind l -> Kind l

-- | '(k1,k2,k3), a promoted tuple
KindTuple :: l -> [Kind l] -> Kind l

-- | '[k1], a promoted list literal
KindList :: l -> Kind l -> Kind l

-- | A functional dependency, given on the form l1 l2 ... ln -> r2 r3 ..
--   rn
data FunDep l
FunDep :: l -> [Name l] -> [Name l] -> FunDep l

-- | A context is a set of assertions
data Context l
CxSingle :: l -> Asst l -> Context l
CxTuple :: l -> [Asst l] -> Context l
CxEmpty :: l -> Context l

-- | Class assertions. In Haskell 98, the argument would be a tyvar,
--   but this definition allows multiple parameters, and allows them to be
--   types. Also extended with support for implicit parameters and
--   equality constraints.
data Asst l

-- | ordinary class assertion
ClassA :: l -> QName l -> [Type l] -> Asst l

-- | constraint kind assertion, Dict :: cxt a => Dict cxt
AppA :: l -> Name l -> [Type l] -> Asst l

-- | class assertion where the class name is given infix
InfixA :: l -> Type l -> QName l -> Type l -> Asst l

-- | implicit parameter assertion
IParam :: l -> IPName l -> Type l -> Asst l

-- | type equality constraint
EqualP :: l -> Type l -> Type l -> Asst l

-- | parenthesised class assertion
ParenA :: l -> Asst l -> Asst l

-- | Context Wildcard
WildCardA :: l -> Maybe (Name l) -> Asst l

-- | literal Values of this type hold the abstract value of the
--   literal, along with the precise string representation used. For
--   example, 10, 0o12 and 0xa have the same
--   value representation, but each carry a different string
--   representation.
data Literal l

-- | character literal
Char :: l -> Char -> String -> Literal l

-- | floating point literal
Frac :: l -> Rational -> String -> Literal l

-- | unboxed integer literal
PrimInt :: l -> Integer -> String -> Literal l

-- | unboxed word literal
PrimWord :: l -> Integer -> String -> Literal l

-- | unboxed float literal
PrimFloat :: l -> Rational -> String -> Literal l

-- | unboxed double literal
PrimDouble :: l -> Rational -> String -> Literal l

-- | unboxed character literal
PrimChar :: l -> Char -> String -> Literal l

-- | unboxed string literal
PrimString :: l -> String -> String -> Literal l

-- | An indication whether a literal pattern has been negated or not.
data Sign l
Signless :: l -> Sign l
Negative :: l -> Sign l

-- | Haskell expressions.
data Exp l

-- | variable
Var :: l -> QName l -> Exp l

-- | Overloaded label #foo
OverloadedLabel :: l -> String -> Exp l

-- | implicit parameter variable
IPVar :: l -> IPName l -> Exp l

-- | data constructor
Con :: l -> QName l -> Exp l

-- | literal constant
Lit :: l -> Literal l -> Exp l

-- | infix application
InfixApp :: l -> Exp l -> QOp l -> Exp l -> Exp l

-- | negation expression -exp (unary minus)
NegApp :: l -> Exp l -> Exp l

-- | lambda expression
Lambda :: l -> [Pat l] -> Exp l -> Exp l

-- | local declarations with let ... in ...
Let :: l -> Binds l -> Exp l -> Exp l

-- | if exp then exp else
--   exp
If :: l -> Exp l -> Exp l -> Exp l -> Exp l

-- | if | stmts -> exp ...
MultiIf :: l -> [GuardedRhs l] -> Exp l

-- | case exp of alts
Case :: l -> Exp l -> [Alt l] -> Exp l

-- | do-expression: the last statement in the list should be an
--   expression.
Do :: l -> [Stmt l] -> Exp l

-- | mdo-expression
MDo :: l -> [Stmt l] -> Exp l

-- | tuple expression
Tuple :: l -> Boxed -> [Exp l] -> Exp l

-- | unboxed sum
UnboxedSum :: l -> Int -> Int -> Exp l -> Exp l

-- | tuple section expression, e.g. (,,3)
TupleSection :: l -> Boxed -> [Maybe (Exp l)] -> Exp l

-- | parallel array expression
ParArray :: l -> [Exp l] -> Exp l

-- | parenthesised expression
Paren :: l -> Exp l -> Exp l

-- | left section (exp qop)
LeftSection :: l -> Exp l -> QOp l -> Exp l

-- | right section (qop exp)
RightSection :: l -> QOp l -> Exp l -> Exp l

-- | record construction expression
RecConstr :: l -> QName l -> [FieldUpdate l] -> Exp l

-- | record update expression
RecUpdate :: l -> Exp l -> [FieldUpdate l] -> Exp l

-- | unbounded arithmetic sequence, incrementing by 1: [from ..]
EnumFrom :: l -> Exp l -> Exp l

-- | bounded arithmetic sequence, incrementing by 1 [from .. to]
EnumFromTo :: l -> Exp l -> Exp l -> Exp l

-- | unbounded arithmetic sequence, with first two elements given
--   [from, then ..]
EnumFromThen :: l -> Exp l -> Exp l -> Exp l

-- | bounded arithmetic sequence, with first two elements given [from,
--   then .. to]
EnumFromThenTo :: l -> Exp l -> Exp l -> Exp l -> Exp l

-- | Parallel array bounded arithmetic sequence, incrementing by 1
--   [:from .. to:]
ParArrayFromTo :: l -> Exp l -> Exp l -> Exp l

-- | bounded arithmetic sequence, with first two elements given [:from,
--   then .. to:]
ParArrayFromThenTo :: l -> Exp l -> Exp l -> Exp l -> Exp l

-- | ordinary list comprehension
ListComp :: l -> Exp l -> [QualStmt l] -> Exp l

-- | parallel list comprehension
ParComp :: l -> Exp l -> [[QualStmt l]] -> Exp l

-- | parallel array comprehension
ParArrayComp :: l -> Exp l -> [[QualStmt l]] -> Exp l

-- | expression with explicit type signature
ExpTypeSig :: l -> Exp l -> Type l -> Exp l

-- | 'x for template haskell reifying of expressions
VarQuote :: l -> QName l -> Exp l

-- | ''T for template haskell reifying of types
TypQuote :: l -> QName l -> Exp l

-- | template haskell bracket expression
BracketExp :: l -> Bracket l -> Exp l

-- | template haskell splice expression
SpliceExp :: l -> Splice l -> Exp l

-- | quasi-quotaion: [$name| string |]
QuasiQuote :: l -> String -> String -> Exp l

-- | Visible type application
TypeApp :: l -> Type l -> Exp l

-- | xml element, with attributes and children
XTag :: l -> XName l -> [XAttr l] -> Maybe (Exp l) -> [Exp l] -> Exp l

-- | empty xml element, with attributes
XETag :: l -> XName l -> [XAttr l] -> Maybe (Exp l) -> Exp l

-- | PCDATA child element
XPcdata :: l -> String -> Exp l

-- | escaped haskell expression inside xml
XExpTag :: l -> Exp l -> Exp l

-- | children of an xml element
XChildTag :: l -> [Exp l] -> Exp l

-- | CORE pragma
CorePragma :: l -> String -> Exp l -> Exp l

-- | SCC pragma
SCCPragma :: l -> String -> Exp l -> Exp l

-- | GENERATED pragma
GenPragma :: l -> String -> (Int, Int) -> (Int, Int) -> Exp l -> Exp l

-- | arrows proc: proc pat -> exp
Proc :: l -> Pat l -> Exp l -> Exp l

-- | arrow application (from left): exp -< exp
LeftArrApp :: l -> Exp l -> Exp l -> Exp l

-- | arrow application (from right): exp >- exp
RightArrApp :: l -> Exp l -> Exp l -> Exp l

-- | higher-order arrow application (from left): exp
--   -<< exp
LeftArrHighApp :: l -> Exp l -> Exp l -> Exp l

-- | higher-order arrow application (from right): exp
--   >>- exp
RightArrHighApp :: l -> Exp l -> Exp l -> Exp l

-- | case alts
LCase :: l -> [Alt l] -> Exp l

-- | The name of an xml element or attribute, possibly qualified with a
--   namespace.
data XName l
XName :: l -> String -> XName l
XDomName :: l -> String -> String -> XName l

-- | An xml attribute, which is a name-expression pair.
data XAttr l
XAttr :: l -> XName l -> Exp l -> XAttr l

-- | A template haskell bracket expression.
data Bracket l

-- | expression bracket: [| ... |]
ExpBracket :: l -> Exp l -> Bracket l

-- | pattern bracket: [p| ... |]
PatBracket :: l -> Pat l -> Bracket l

-- | type bracket: [t| ... |]
TypeBracket :: l -> Type l -> Bracket l

-- | declaration bracket: [d| ... |]
DeclBracket :: l -> [Decl l] -> Bracket l

-- | A template haskell splice expression
data Splice l

-- | variable splice: $var
IdSplice :: l -> String -> Splice l

-- | parenthesised expression splice: $(exp)
ParenSplice :: l -> Exp l -> Splice l

-- | The safety of a foreign function call.
data Safety l

-- | unsafe
PlayRisky :: l -> Safety l

-- | safe (False) or threadsafe (True)
PlaySafe :: l -> Bool -> Safety l

-- | interruptible
PlayInterruptible :: l -> Safety l

-- | The calling convention of a foreign function call.
data CallConv l
StdCall :: l -> CallConv l
CCall :: l -> CallConv l
CPlusPlus :: l -> CallConv l
DotNet :: l -> CallConv l
Jvm :: l -> CallConv l
Js :: l -> CallConv l
JavaScript :: l -> CallConv l
CApi :: l -> CallConv l

-- | A top level options pragma, preceding the module header.
data ModulePragma l

-- | LANGUAGE pragma
LanguagePragma :: l -> [Name l] -> ModulePragma l

-- | OPTIONS pragma, possibly qualified with a tool, e.g. OPTIONS_GHC
OptionsPragma :: l -> Maybe Tool -> String -> ModulePragma l

-- | ANN pragma with module scope
AnnModulePragma :: l -> Annotation l -> ModulePragma l

-- | Recognised tools for OPTIONS pragmas.
data Tool
GHC :: Tool
HUGS :: Tool
NHC98 :: Tool
YHC :: Tool
HADDOCK :: Tool
UnknownTool :: String -> Tool

-- | Recognised overlaps for overlap pragmas.
data Overlap l

-- | NO_OVERLAP pragma
NoOverlap :: l -> Overlap l

-- | OVERLAP pragma
Overlap :: l -> Overlap l
Overlapping :: l -> Overlap l
Overlaps :: l -> Overlap l
Overlappable :: l -> Overlap l

-- | INCOHERENT pragma
Incoherent :: l -> Overlap l

-- | Activation clause of a RULES pragma.
data Activation l
ActiveFrom :: l -> Int -> Activation l
ActiveUntil :: l -> Int -> Activation l

-- | The body of a RULES pragma.
data Rule l
Rule :: l -> String -> Maybe (Activation l) -> Maybe [RuleVar l] -> Exp l -> Exp l -> Rule l

-- | Variables used in a RULES pragma, optionally annotated with types
data RuleVar l
RuleVar :: l -> Name l -> RuleVar l
TypedRuleVar :: l -> Name l -> Type l -> RuleVar l

-- | Warning text to optionally use in the module header of e.g. a
--   deprecated module.
data WarningText l
DeprText :: l -> String -> WarningText l
WarnText :: l -> String -> WarningText l

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

-- | variable
PVar :: l -> Name l -> Pat l

-- | literal constant
PLit :: l -> Sign l -> Literal l -> Pat l

-- | n+k pattern
PNPlusK :: l -> Name l -> Integer -> Pat l

-- | pattern with an infix data constructor
PInfixApp :: l -> Pat l -> QName l -> Pat l -> Pat l

-- | data constructor and argument patterns
PApp :: l -> QName l -> [Pat l] -> Pat l

-- | tuple pattern
PTuple :: l -> Boxed -> [Pat l] -> Pat l

-- | unboxed sum
PUnboxedSum :: l -> Int -> Int -> Pat l -> Pat l

-- | list pattern
PList :: l -> [Pat l] -> Pat l

-- | parenthesized pattern
PParen :: l -> Pat l -> Pat l

-- | labelled pattern, record style
PRec :: l -> QName l -> [PatField l] -> Pat l

-- | @-pattern
PAsPat :: l -> Name l -> Pat l -> Pat l

-- | wildcard pattern: _
PWildCard :: l -> Pat l

-- | irrefutable pattern: ~pat
PIrrPat :: l -> Pat l -> Pat l

-- | pattern with type signature
PatTypeSig :: l -> Pat l -> Type l -> Pat l

-- | view patterns of the form (exp -> pat)
PViewPat :: l -> Exp l -> Pat l -> Pat l

-- | regular list pattern
PRPat :: l -> [RPat l] -> Pat l

-- | XML element pattern
PXTag :: l -> XName l -> [PXAttr l] -> Maybe (Pat l) -> [Pat l] -> Pat l

-- | XML singleton element pattern
PXETag :: l -> XName l -> [PXAttr l] -> Maybe (Pat l) -> Pat l

-- | XML PCDATA pattern
PXPcdata :: l -> String -> Pat l

-- | XML embedded pattern
PXPatTag :: l -> Pat l -> Pat l

-- | XML regular list pattern
PXRPats :: l -> [RPat l] -> Pat l

-- | template haskell splice pattern
PSplice :: l -> Splice l -> Pat l

-- | quasi quote pattern: [$name| string |]
PQuasiQuote :: l -> String -> String -> Pat l

-- | strict (bang) pattern: f !x = ...
PBangPat :: l -> Pat l -> Pat l

-- | An XML attribute in a pattern.
data PXAttr l
PXAttr :: l -> XName l -> Pat l -> PXAttr l

-- | A regular pattern operator.
data RPatOp l

-- | * = 0 or more
RPStar :: l -> RPatOp l

-- | *! = 0 or more, greedy
RPStarG :: l -> RPatOp l

-- | + = 1 or more
RPPlus :: l -> RPatOp l

-- | +! = 1 or more, greedy
RPPlusG :: l -> RPatOp l

-- | ? = 0 or 1
RPOpt :: l -> RPatOp l

-- | ?! = 0 or 1, greedy
RPOptG :: l -> RPatOp l

-- | An entity in a regular pattern.
data RPat l

-- | operator pattern, e.g. pat*
RPOp :: l -> RPat l -> RPatOp l -> RPat l

-- | choice pattern, e.g. (1 | 2)
RPEither :: l -> RPat l -> RPat l -> RPat l

-- | sequence pattern, e.g. (| 1, 2, 3 |)
RPSeq :: l -> [RPat l] -> RPat l

-- | guarded pattern, e.g. (| p | p < 3 |)
RPGuard :: l -> Pat l -> [Stmt l] -> RPat l

-- | non-linear variable binding, e.g. (foo@:(1 | 2))*
RPCAs :: l -> Name l -> RPat l -> RPat l

-- | linear variable binding, e.g. foo@(1 | 2)
RPAs :: l -> Name l -> RPat l -> RPat l

-- | parenthesised pattern, e.g. (2*)
RPParen :: l -> RPat l -> RPat l

-- | an ordinary pattern
RPPat :: l -> Pat l -> RPat l

-- | An fpat in a labeled record pattern.
data PatField l

-- | ordinary label-pattern pair
PFieldPat :: l -> QName l -> Pat l -> PatField l

-- | record field pun
PFieldPun :: l -> QName l -> PatField l

-- | record field wildcard
PFieldWildcard :: l -> PatField l

-- | A statement, representing both a stmt in a
--   do-expression, an ordinary qual in a list
--   comprehension, as well as a stmt in a pattern guard.
data Stmt l

-- | a generator: pat <- exp
Generator :: l -> Pat l -> Exp l -> Stmt l

-- | an exp by itself: in a do-expression, an action whose
--   result is discarded; in a list comprehension and pattern guard, a
--   guard expression
Qualifier :: l -> Exp l -> Stmt l

-- | local bindings
LetStmt :: l -> Binds l -> Stmt l

-- | a recursive binding group for arrows
RecStmt :: l -> [Stmt l] -> Stmt l

-- | A general transqual in a list comprehension, which could
--   potentially be a transform of the kind enabled by TransformListComp.
data QualStmt l

-- | an ordinary statement
QualStmt :: l -> Stmt l -> QualStmt l

-- | then exp
ThenTrans :: l -> Exp l -> QualStmt l

-- | then exp by exp
ThenBy :: l -> Exp l -> Exp l -> QualStmt l

-- | then group by exp
GroupBy :: l -> Exp l -> QualStmt l

-- | then group using exp
GroupUsing :: l -> Exp l -> QualStmt l

-- | then group by exp using
--   exp
GroupByUsing :: l -> Exp l -> Exp l -> QualStmt l

-- | An fbind in a labeled construction or update expression.
data FieldUpdate l

-- | ordinary label-expresion pair
FieldUpdate :: l -> QName l -> Exp l -> FieldUpdate l

-- | record field pun
FieldPun :: l -> QName l -> FieldUpdate l

-- | record field wildcard
FieldWildcard :: l -> FieldUpdate l

-- | An alt alternative in a case expression.
data Alt l
Alt :: l -> Pat l -> Rhs l -> Maybe (Binds l) -> Alt l

-- | AST nodes are annotated, and this class allows manipulation of the
--   annotations.
class Functor ast => Annotated (ast :: Type -> Type)

-- | Retrieve the annotation of an AST node.
ann :: Annotated ast => ast l -> l

-- | Change the annotation of an AST node. Note that only the annotation of
--   the node itself is affected, and not the annotations of any child
--   nodes. if all nodes in the AST tree are to be affected, use
--   fmap.
amap :: Annotated ast => (l -> l) -> ast l -> ast l

-- | Merge two SrcSpans and lift them to a SrcInfoSpan with
--   no positional information for entities.
(<^^>) :: SrcSpan -> SrcSpan -> SrcSpanInfo
infixl 6 <^^>

-- | Add more positional information for entities of a span.
(<**) :: SrcSpanInfo -> [SrcSpan] -> SrcSpanInfo
infixl 4 <**

-- | Optionally combine the second argument with the first, or return it
--   unchanged if the first argument is Nothing.
(<?+>) :: Maybe SrcSpanInfo -> SrcSpanInfo -> SrcSpanInfo
infixl 4 <?+>

-- | Optionally combine the first argument with the second, or return it
--   unchanged if the second argument is Nothing.
(<+?>) :: SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo
infixl 4 <+?>

-- | Short name for combSpanInfo
(<++>) :: SrcSpanInfo -> SrcSpanInfo -> SrcSpanInfo
infixl 5 <++>

-- | Like '(+?)', but it also concatenates the srcInfoPoints.
combSpanMaybe :: SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo

-- | Combine two SrcSpanInfos into one that spans the combined
--   source area of the two arguments, leaving positional information
--   blank.
combSpanInfo :: SrcSpanInfo -> SrcSpanInfo -> SrcSpanInfo

-- | Generate a SrcSpanInfo with the supplied positional information
--   for entities.
infoSpan :: SrcSpan -> [SrcSpan] -> SrcSpanInfo

-- | A bogus SrcSpanInfo, the location is noLoc. `noSrcSpan
--   = noInfoSpan (mkSrcSpan noLoc noLoc)`
noSrcSpan :: SrcSpanInfo

-- | Generate a SrcSpanInfo with no positional information for
--   entities.
noInfoSpan :: SrcSpan -> SrcSpanInfo
spanSize :: SrcSpan -> (Int, Int)

-- | Test if a given span starts and ends at the same location.
isNullSpan :: SrcSpan -> Bool

-- | Merge two source spans into a single span from the start of the first
--   to the end of the second. Assumes that the two spans relate to the
--   same source file.
mergeSrcSpan :: SrcSpan -> SrcSpan -> SrcSpan

-- | Combine two locations in the source to denote a span.
mkSrcSpan :: SrcLoc -> SrcLoc -> SrcSpan

-- | Returns srcSpanEndLine and srcSpanEndColumn in a pair.
srcSpanEnd :: SrcSpan -> (Int, Int)

-- | Returns srcSpanStartLine and srcSpanStartColumn in a
--   pair.
srcSpanStart :: SrcSpan -> (Int, Int)
noLoc :: SrcLoc

-- | A single position in the source.
data SrcLoc
SrcLoc :: String -> Int -> Int -> SrcLoc
[srcFilename] :: SrcLoc -> String
[srcLine] :: SrcLoc -> Int
[srcColumn] :: SrcLoc -> Int

-- | A portion of the source, spanning one or more lines and zero or more
--   columns.
data SrcSpan
SrcSpan :: String -> Int -> Int -> Int -> Int -> SrcSpan
[srcSpanFilename] :: SrcSpan -> String
[srcSpanStartLine] :: SrcSpan -> Int
[srcSpanStartColumn] :: SrcSpan -> Int
[srcSpanEndLine] :: SrcSpan -> Int
[srcSpanEndColumn] :: SrcSpan -> Int

-- | An entity located in the source.
data Loc a
Loc :: SrcSpan -> a -> Loc a
[loc] :: Loc a -> SrcSpan
[unLoc] :: Loc a -> a

-- | A portion of the source, extended with information on the position of
--   entities within the span.
data SrcSpanInfo
SrcSpanInfo :: SrcSpan -> [SrcSpan] -> SrcSpanInfo
[srcInfoSpan] :: SrcSpanInfo -> SrcSpan
[srcInfoPoints] :: SrcSpanInfo -> [SrcSpan]

-- | A class to work over all kinds of source location information.
class SrcInfo si
toSrcInfo :: SrcInfo si => SrcLoc -> [SrcSpan] -> SrcLoc -> si
fromSrcInfo :: SrcInfo si => SrcSpanInfo -> si
getPointLoc :: SrcInfo si => si -> SrcLoc
fileName :: SrcInfo si => si -> String
startLine :: SrcInfo si => si -> Int
startColumn :: SrcInfo si => si -> Int
toExtensionList :: Language -> [Extension] -> [KnownExtension]

-- | Pretty print an extension. Disabled extensions are prefixed with 'No'.
prettyExtension :: Extension -> String

-- | Parse an enabled or disabled extension; returns
--   UnknownExtension if the parse fails.
parseExtension :: String -> Extension

-- | A clever version of read that returns an UnknownExtension if
--   the string is not recognised.
classifyExtension :: String -> Extension

-- | Extensions that have been deprecated, possibly paired with another
--   extension that replaces it.
deprecatedExtensions :: [(Extension, Maybe Extension)]

-- | List of all known extensions, both "yes" and "no" versions.
knownExtensions :: [Extension]
ghcDefault :: [Extension]

-- | The list of extensions enabled by GHC's portmanteau -fglasgow-exts
--   flag.
glasgowExts :: [Extension]

-- | Certain extensions imply other extensions, and this function makes the
--   implication explicit. This also handles deprecated extensions, which
--   imply their replacements. The returned value is the transitive closure
--   of implied extensions.
impliesExts :: [KnownExtension] -> [KnownExtension]
prettyLanguage :: Language -> String
classifyLanguage :: String -> Language
knownLanguages :: [Language]
data Language

-- | The Haskell 98 language as defined by the Haskell 98 report.
--   http://haskell.org/onlinereport/
Haskell98 :: Language

-- | The Haskell 2010 language as defined by the Haskell 2010 report.
--   http://www.haskell.org/onlinereport/haskell2010
Haskell2010 :: Language

-- | The minimal language resulting from disabling all recognized
--   extensions - including ones that are part of all known language
--   definitions e.g. MonomorphismRestriction.
HaskellAllDisabled :: Language

-- | An unknown language, identified by its name.
UnknownLanguage :: String -> Language

-- | This represents language extensions beyond a base Language
--   definition (such as Haskell98) that are supported by some
--   implementations, usually in some special mode.
data Extension

-- | Enable a known extension
EnableExtension :: KnownExtension -> Extension

-- | Disable a known extension
DisableExtension :: KnownExtension -> Extension

-- | An unknown extension, identified by the name of its LANGUAGE
--   pragma.
UnknownExtension :: String -> Extension
data KnownExtension

-- | 
--   
- GHC § 7.6.3.4 Allow overlapping class instances, provided
--   there is a unique most specific instance for each use.
--   
OverlappingInstances :: KnownExtension

-- | 
--   
- GHC § 7.6.3.3 Ignore structural rules guaranteeing the
--   termination of class instance resolution. Termination is guaranteed by
--   a fixed-depth recursion stack, and compilation may fail if this depth
--   is exceeded.
--   
UndecidableInstances :: KnownExtension

-- | 
--   
- GHC § 7.6.3.4 Implies OverlappingInstances. Allow
--   the implementation to choose an instance even when it is possible that
--   further instantiation of types will lead to a more specific instance
--   being applicable.
--   
IncoherentInstances :: KnownExtension

-- | 
--   
- GHC § 7.6.3.5 Allow type signatures in instances.
--   
InstanceSigs :: KnownExtension

-- | 
--   
- GHC § 7.3.8 Deprecated in GHC. Allows recursive bindings in
--   do blocks, using the rec keyword.
--   
DoRec :: KnownExtension

-- | 
--   
- GHC § 7.3.8.2 Allows recursive bindings using mdo,
--   a variant of do, and rec.
--   
RecursiveDo :: KnownExtension

-- | 
--   
- GHC § 7.3.9 Provide syntax for writing list comprehensions
--   which iterate over several lists together, like the zipWith
--   family of functions.
--   
ParallelListComp :: KnownExtension

-- | 
--   
- GHC § 7.6.1.1 Allow multiple parameters in a type
--   class.
--   
MultiParamTypeClasses :: KnownExtension

-- | 
--   
- GHC § 7.17 Enable the dreaded monomorphism
--   restriction.
--   
MonomorphismRestriction :: KnownExtension

-- | 
--   
- GHC § 7.6.2 Allow a specification attached to a
--   multi-parameter type class which indicates that some parameters are
--   entirely determined by others. The implementation will check that this
--   property holds for the declared instances, and will use this property
--   to reduce ambiguity in instance resolution.
--   
FunctionalDependencies :: KnownExtension

-- | 
--   
- GHC § 7.8.5 Like RankNTypes but does not allow a
--   higher-rank type to itself appear on the left of a function
--   arrow.
--   
Rank2Types :: KnownExtension

-- | 
--   
- GHC § 7.8.5 Allow a universally-quantified type to occur on
--   the left of a function arrow.
--   
RankNTypes :: KnownExtension

-- | 
--   
- GHC § 7.8.5 Allow data constructors to have polymorphic
--   arguments. Unlike RankNTypes, does not allow this for ordinary
--   functions.
--   
PolymorphicComponents :: KnownExtension

-- | 
--   
- GHC § 7.4.4 Allow existentially-quantified data
--   constructors.
--   
ExistentialQuantification :: KnownExtension

-- | 
--   
- GHC § 7.8.7 Cause a type variable in a signature, which has
--   an explicit forall quantifier, to scope over the definition
--   of the accompanying value declaration.
--   
ScopedTypeVariables :: KnownExtension

-- | Deprecated, use ScopedTypeVariables instead.
PatternSignatures :: KnownExtension

-- | 
--   
- GHC § 7.8.3 Enable implicit function parameters with
--   dynamic scope.
--   
ImplicitParams :: KnownExtension

-- | 
--   
- GHC § 7.8.2 Relax some restrictions on the form of the
--   context of a type signature.
--   
FlexibleContexts :: KnownExtension

-- | 
--   
- GHC § 7.6.3.2 Relax some restrictions on the form of the
--   context of an instance declaration.
--   
FlexibleInstances :: KnownExtension

-- | 
--   
- GHC § 7.4.1 Allow data type declarations with no
--   constructors.
--   
EmptyDataDecls :: KnownExtension

-- | 
--   
- GHC § 4.10.3 Run the C preprocessor on Haskell source
--   code.
--   
CPP :: KnownExtension

-- | 
--   
- GHC § 7.8.4 Allow an explicit kind signature giving the
--   kind of types over which a type variable ranges.
--   
KindSignatures :: KnownExtension

-- | 
--   
- GHC § 7.11 Enable a form of pattern which forces evaluation
--   before an attempted match, and a form of strict
--   let/where binding.
--   
BangPatterns :: KnownExtension

-- | 
--   
- GHC § 7.6.3.1 Allow type synonyms in instance heads.
--   
TypeSynonymInstances :: KnownExtension

-- | 
--   
- GHC § 7.9 Enable Template Haskell, a system for
--   compile-time metaprogramming.
--   
TemplateHaskell :: KnownExtension

-- | 
--   
- GHC § 8 Enable the Foreign Function Interface. In GHC,
--   implements the standard Haskell 98 Foreign Function Interface
--   Addendum, plus some GHC-specific extensions.
--   
ForeignFunctionInterface :: KnownExtension

-- | 
--   
- GHC § 7.10 Enable arrow notation.
--   
Arrows :: KnownExtension

-- | 
--   
- GHC § 7.16 Enable generic type classes, with default
--   instances defined in terms of the algebraic structure of a type.
--   
Generics :: KnownExtension

-- | 
--   
- GHC § 7.3.11 Enable the implicit importing of the module
--   Prelude. When disabled, when desugaring certain built-in
--   syntax into ordinary identifiers, use whatever is in scope rather than
--   the Prelude -- version.
--   
ImplicitPrelude :: KnownExtension

-- | 
--   
- GHC § 7.3.15 Enable syntax for implicitly binding local
--   names corresponding to the field names of a record. Puns bind specific
--   names, unlike RecordWildCards.
--   
NamedFieldPuns :: KnownExtension

-- | 
--   
- GHC § 7.3.5 Enable a form of guard which matches a pattern
--   and binds variables.
--   
PatternGuards :: KnownExtension

-- | 
--   
- GHC § 7.5.4 Allow a type declared with newtype to
--   use deriving for any class with an instance for the
--   underlying type.
--   
GeneralizedNewtypeDeriving :: KnownExtension

-- | 
--   
- GHC § 9.6.10 Allow use of any typeclass in deriving
--   clauses.
--   
DeriveAnyClass :: KnownExtension

-- | 
--   
- Hugs § 7.1 Enable the "Trex" extensible records
--   system.
--   
ExtensibleRecords :: KnownExtension

-- | 
--   
- Hugs § 7.2 Enable type synonyms which are transparent in
--   some definitions and opaque elsewhere, as a way of implementing
--   abstract datatypes.
--   
RestrictedTypeSynonyms :: KnownExtension

-- | 
--   
- Hugs § 7.3 Enable an alternate syntax for string literals,
--   with string templating.
--   
HereDocuments :: KnownExtension

-- | 
--   
- GHC § 7.3.2 Allow the character # as a postfix
--   modifier on identifiers. Also enables literal syntax for unboxed
--   values.
--   
MagicHash :: KnownExtension

-- | Binary integer literals
BinaryLiterals :: KnownExtension

-- | 
--   
- GHC § 7.7 Allow data types and type synonyms which are
--   indexed by types, i.e. ad-hoc polymorphism for types.
--   
TypeFamilies :: KnownExtension

-- | 
--   
- GHC § 7.5.2 Allow a standalone declaration which invokes
--   the type class deriving mechanism.
--   
StandaloneDeriving :: KnownExtension

-- | 
--   
- GHC § 7.3.1 Allow certain Unicode characters to stand for
--   certain ASCII character sequences, e.g. keywords and punctuation.
--   
UnicodeSyntax :: KnownExtension

-- | 
--   
- GHC § 8.1.1 Allow the use of unboxed types as foreign
--   types, e.g. in foreign import and foreign
--   export.
--   
UnliftedFFITypes :: KnownExtension

-- | 
--   
- GHC § 7.4.3 Defer validity checking of types until after
--   expanding type synonyms, relaxing the constraints on how synonyms may
--   be used.
--   
LiberalTypeSynonyms :: KnownExtension

-- | 
--   
- GHC § 7.4.2 Allow the name of a type constructor, type
--   class, or type variable to be an infix operator.
--   
TypeOperators :: KnownExtension

-- | 
--   
- GHC § 7.26.5 Parallel arrays for Data Parallel
--   Haskell.
--   
ParallelArrays :: KnownExtension

-- | 
--   
- GHC § 7.3.16 Enable syntax for implicitly binding local
--   names corresponding to the field names of a record. A wildcard binds
--   all unmentioned names, unlike NamedFieldPuns.
--   
RecordWildCards :: KnownExtension

-- | Deprecated, use NamedFieldPuns instead.
RecordPuns :: KnownExtension

-- | 
--   
- GHC § 7.3.14 Allow a record field name to be disambiguated
--   by the type of the record it's in.
--   
DisambiguateRecordFields :: KnownExtension

-- | 
--   
- GHC § 7.6.4 Enable overloading of string literals using a
--   type class, much like integer literals.
--   
OverloadedStrings :: KnownExtension

-- | 
--   
- GHC § 7.4.6 Enable generalized algebraic data types, in
--   which type variables may be instantiated on a per-constructor basis.
--   Implies GADTSyntax.
--   
GADTs :: KnownExtension

-- | 
--   
- GHC § 7.17.2 Make pattern bindings monomorphic.
--   
MonoPatBinds :: KnownExtension

-- | 
--   
- GHC § 7.8.8 Relax the requirements on mutually-recursive
--   polymorphic functions.
--   
RelaxedPolyRec :: KnownExtension

-- | 
--   
- GHC § 2.4.5 Allow default instantiation of polymorphic
--   types in more situations.
--   
ExtendedDefaultRules :: KnownExtension

-- | 
--   
- GHC § 7.2.2 Enable unboxed tuples.
--   
UnboxedTuples :: KnownExtension

-- | 
--   
- GHC § 7.5.3 Enable deriving for classes
--   Data.Typeable.Typeable and Data.Generics.Data.
--   
DeriveDataTypeable :: KnownExtension

-- | 
--   
- GHC § 7.6.1.3 Allow a class method's type to place
--   additional constraints on a class type variable.
--   
ConstrainedClassMethods :: KnownExtension

-- | 
--   
- GHC § 7.3.18 Allow imports to be qualified by the package
--   name the module is intended to be imported from, e.g.
--   
--   
--   
--   import "network" Network.Socket
--   
PackageImports :: KnownExtension
LambdaCase :: KnownExtension

-- | 
--   
- GHC § 7.3.20 Allow case expressions with no
--   alternatives.
--   
EmptyCase :: KnownExtension

-- | 
--   
- GHC § 7.8.6 Deprecated in GHC 6.12 and will be removed in
--   GHC 7. Allow a type variable to be instantiated at a polymorphic
--   type.
--   
ImpredicativeTypes :: KnownExtension

-- | 
--   
- GHC § 7.3.3 Change the syntax for qualified infix
--   operators.
--   
NewQualifiedOperators :: KnownExtension

-- | 
--   
- GHC § 7.3.12 Relax the interpretation of left operator
--   sections to allow unary postfix operators.
--   
PostfixOperators :: KnownExtension

-- | 
--   
- GHC § 7.9.5 Enable quasi-quotation, a mechanism for
--   defining new concrete syntax for expressions and patterns.
--   
QuasiQuotes :: KnownExtension

-- | 
--   
- GHC § 7.3.10 Enable generalized list comprehensions,
--   supporting operations such as sorting and grouping.
--   
TransformListComp :: KnownExtension

-- | 
--   
- GHC § 7.3.6 Enable view patterns, which match a value by
--   applying a function and matching on the result.
--   
ViewPatterns :: KnownExtension

-- | Allow concrete XML syntax to be used in expressions and patterns, as
--   per the Haskell Server Pages extension language:
--   http://www.haskell.org/haskellwiki/HSP. The ideas behind it are
--   discussed in the paper "Haskell Server Pages through Dynamic Loading"
--   by Niklas Broberg, from Haskell Workshop '05.
XmlSyntax :: KnownExtension

-- | Allow regular pattern matching over lists, as discussed in the paper
--   "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and
--   Josef Svenningsson, from ICFP '04.
RegularPatterns :: KnownExtension

-- | Enables the use of tuple sections, e.g. (, True) desugars
--   into x -> (x, True).
TupleSections :: KnownExtension

-- | Allows GHC primops, written in C--, to be imported into a Haskell
--   file.
GHCForeignImportPrim :: KnownExtension

-- | Support for patterns of the form n + k, where k is
--   an integer literal.
NPlusKPatterns :: KnownExtension

-- | Improve the layout rule when if expressions are used in a
--   do block.
DoAndIfThenElse :: KnownExtension

-- | Makes much of the Haskell sugar be desugared into calls to the
--   function with a particular name that is in scope.
RebindableSyntax :: KnownExtension

-- | Make forall a keyword in types, which can be used to give the
--   generalisation explicitly.
ExplicitForAll :: KnownExtension

-- | Allow contexts to be put on datatypes, e.g. the Eq a in
--   data Eq a => Set a = NilSet | ConsSet a (Set a).
DatatypeContexts :: KnownExtension

-- | Local (let and where) bindings are monomorphic.
MonoLocalBinds :: KnownExtension

-- | Enable deriving for the Data.Functor.Functor class.
DeriveFunctor :: KnownExtension

-- | 
--   
- GHC § 7.5.3 Enable deriving for the
--   Generic and Generic1 classes.
--   
DeriveGeneric :: KnownExtension

-- | Enable deriving for the Data.Traversable.Traversable
--   class.
DeriveTraversable :: KnownExtension

-- | Enable deriving for the Data.Foldable.Foldable
--   class.
DeriveFoldable :: KnownExtension

-- | Enable non-decreasing indentation for 'do' blocks.
NondecreasingIndentation :: KnownExtension

-- | 
--   
- GHC § 8.1.4 Enable interruptible FFI.
--   
InterruptibleFFI :: KnownExtension

-- | 
--   
- GHC § 8.1.5 Enable the capi calling convention in
--   the foreign function interface.
--   
CApiFFI :: KnownExtension

-- | GHCJS FFI extension with convenient import patterns, asynchronous FFI
--   and a JSVal FFI type
JavaScriptFFI :: KnownExtension

-- | 
--   
- GHC § 7.3.27 Enable explicit namespaces in
--   import/export.
--   
ExplicitNamespaces :: KnownExtension
DataKinds :: KnownExtension
PolyKinds :: KnownExtension

-- | 
--   
- GHC § 7.3.16 Enable the multi-way if-expressions extension
--   to accept conditional expressions with multiple branches.
--   
MultiWayIf :: KnownExtension

-- | 
--   
- GHC § 7.20.3 Allow imports to be qualified with a safe
--   keyword that requires the imported module be trusted as according to
--   the Safe Haskell definition of trust.
--   
--   
--   
--   import safe Network.Socket
--   
SafeImports :: KnownExtension

-- | 
--   
- GHC § 7.20 Compile a module in the Safe, Safe Haskell mode
--   -- a restricted form of the Haskell language to ensure type
--   safety.
--   
Safe :: KnownExtension

-- | 
--   
- GHC § 7.20 Compile a module in the Trustworthy, Safe
--   Haskell mode -- no restrictions apply but the module is marked as
--   trusted as long as the package the module resides in is trusted.
--   
Trustworthy :: KnownExtension

-- | 
--   
- GHC § 7.6.1.4 Allow default signatures in class
--   definitions. They apply to default methods implemented in this
--   class.
--   
DefaultSignatures :: KnownExtension

-- | 
--   
- GHC § 7.40 Allow type classimplicit
--   parameterequality constraints to be used as types with the special
--   kind Constraint. Also generalise the (ctxt => ty) syntax so that
--   any type of kind Constraint can occur before the arrow.
--   
ConstraintKinds :: KnownExtension

-- | 
--   
- GHC § 7.25.3 Allow role annotations.
--   
RoleAnnotations :: KnownExtension

-- | 
--   
- GHC § 7.3.8 Enable giving names to parametrized pattern
--   schemes
--   
PatternSynonyms :: KnownExtension

-- | 
--   
- GHC § 7.15 Allow partial specified type signatures. Note
--   that this extension does not affect parsing. It only affects whether
--   the program is able to be run with partial signatures.
--   
PartialTypeSignatures :: KnownExtension

-- | 
--   
- GHC § 7.15.1.2 This extension treats type variables which
--   start with an underscore as wildcards. For example, `foo :: _x` is
--   equivalent to `foo :: _`.
--   
NamedWildCards :: KnownExtension
TypeApplications :: KnownExtension
TypeFamilyDependencies :: KnownExtension
OverloadedLabels :: KnownExtension

-- | Allow multiple deriving clauses, each optionally qualified
--   with a strategy.
DerivingStrategies :: KnownExtension
UnboxedSums :: KnownExtension

-- | 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

-- | 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
type FullDataDecl = (ModuleName (), DataDecl)
type FieldDecl = [(String, Type ())]
type CtorDecl = Either (QualConDecl ()) (GadtDecl ())
type DataDecl = Decl ()
(?) :: () => Bool -> a -> a -> a
infix 1 ?
foralls :: Type () -> Type ()
tyApps :: Type () -> [Type ()] -> Type ()
fromTyApps :: Type () -> (Type (), [Type ()])
fromTyTuple :: () => Type l -> [Type l]
fromTyParen :: Type () -> Type ()
fromTyParens :: Type () -> Type ()
tyRoot :: Type () -> String
isTyFun :: Type () -> Bool
isTyParen :: () => Type l -> Bool
fromTyList :: () => Type l -> Maybe (Type l)
(~=) :: Pretty a => a -> String -> Bool
appP :: Exp () -> Exp () -> Exp ()
simplify :: Data a => a -> a
isGuardFalse :: () => Match l -> Bool
rename :: QName () -> QName ()
isAtom :: () => Exp l -> Bool
paren :: Exp () -> Exp ()
sl :: SrcLoc
noSl :: Data from => from -> from
isIdent :: [Char] -> Bool
title :: [Char] -> [Char]
qname :: String -> QName ()
var :: String -> Exp ()
con :: String -> Exp ()
tyVar :: String -> Type ()
tyVarBind :: String -> TyVarBind ()
tyCon :: String -> Type ()
pVar :: String -> Pat ()
qvop :: String -> QOp ()
dataDeclType :: DataDecl -> Type ()
dataDeclFields :: DataDecl -> [String]
moduleName :: () => Module l -> ModuleName l
moduleDecls :: () => Module l -> [Decl l]
moduleImports :: () => Module l -> [ImportDecl l]
modulePragmas :: () => Module l -> [ModulePragma l]
showDecls :: Pretty a => [a] -> String
tyApp :: Type () -> [Type ()] -> Type ()
tyFun :: [Type ()] -> Type ()
apps :: Exp () -> [Exp ()] -> Exp ()
bind :: String -> [Pat ()] -> Exp () -> Decl ()
binds :: String -> [([Pat ()], Exp ())] -> Decl ()
isDataDecl :: Decl () -> Bool
dataDeclName :: DataDecl -> String
fromDeclHead :: DeclHead a -> (Name a, [TyVarBind a])
fromIParen :: InstRule a -> InstRule a
fromInstHead :: InstHead a -> (QName a, [Type a])
dataDeclVars :: DataDecl -> [String]
dataDeclVarsStar :: DataDecl -> [String]
dataDeclArity :: DataDecl -> Int
dataDeclCtors :: DataDecl -> [CtorDecl]
ctorDeclName :: CtorDecl -> String
ctorDeclName' :: CtorDecl -> Name ()
ctorDeclFields :: CtorDecl -> FieldDecl
ctorDeclArity :: CtorDecl -> Int
declName :: Decl () -> String
instance Data.Data.Data Data.Derive.DSL.HSE.Output
instance GHC.Show.Show Data.Derive.DSL.HSE.Output
instance GHC.Classes.Eq Data.Derive.DSL.HSE.Output

module Data.Derive.DSL.DSL
data DSL
App :: String -> DSL -> DSL
Concat :: DSL -> DSL
Reverse :: DSL -> DSL
String :: String -> DSL
ShowInt :: DSL -> DSL
Int :: Integer -> DSL
List :: [DSL] -> DSL
MapField :: DSL -> DSL
MapCtor :: DSL -> DSL
DataName :: DSL
CtorName :: DSL
CtorIndex :: DSL
CtorArity :: DSL
FieldIndex :: DSL
Fold :: DSL -> DSL -> DSL
Head :: DSL
Tail :: DSL
Instance :: [String] -> String -> DSL -> DSL
Application :: DSL -> DSL
box :: DSL -> DSL
nil :: DSL
append :: DSL -> DSL -> DSL
fromOut :: Output -> DSL
simplifyDSL :: DSL -> DSL
prettyTex :: DSL -> String
instance GHC.Show.Show Data.Derive.DSL.DSL.DSL
instance Data.Data.Data Data.Derive.DSL.DSL.DSL

module Data.Derive.DSL.SYB
dslSYB :: DSL -> Maybe Out

module Data.Derive.DSL.Apply
apply :: DSL -> Input -> Out
applyEnv :: DSL -> Env -> Output
env :: Env
data Env
Env :: Input -> Ctor -> Integer -> (Output, Output) -> Env
[envInput] :: Env -> Input
[envCtor] :: Env -> Ctor
[envField] :: Env -> Integer
[envFold] :: Env -> (Output, Output)

module Data.Derive.DSL.Derive
derive :: Out -> [DSL]
instance GHC.Show.Show Data.Derive.DSL.Derive.Guess

module Data.DeriveDSL
data DSL
deriveDSL :: [Decl ()] -> Maybe DSL
applyDSL :: DSL -> DataDecl -> Either String [Decl ()]
dynamicDSL :: DSL -> Maybe [Decl ()]

module Data.Derive.Internal.Derivation
data Derivation
Derivation :: String -> (Type () -> (String -> Decl ()) -> FullDataDecl -> Either String [Decl ()]) -> Derivation
[derivationName] :: Derivation -> String
[derivationOp] :: Derivation -> Type () -> (String -> Decl ()) -> FullDataDecl -> Either String [Decl ()]
derivationParams :: String -> ([Type ()] -> (String -> Decl ()) -> FullDataDecl -> Either String [Decl ()]) -> Derivation
derivationCustom :: String -> (FullDataDecl -> Either String [Decl ()]) -> Derivation
derivationDSL :: String -> DSL -> Derivation
derivationCustomDSL :: String -> (FullDataDecl -> [Decl ()] -> [Decl ()]) -> DSL -> Derivation
customSplice :: (FullDataDecl -> Exp () -> Exp ()) -> FullDataDecl -> [Decl ()] -> [Decl ()]
customContext :: (FullDataDecl -> Context () -> Context ()) -> FullDataDecl -> [Decl ()] -> [Decl ()]

-- | A Pseudo derivation. For every label, creates a function foo_u and
--   foo_s which updates and sets the label respectively, e.g. 'foo_u (+1)
--   bar' or 'foo_s 10 baz'
module Data.Derive.Update
makeUpdate :: Derivation

module Data.Derive.UniplateTypeable
makeUniplateTypeable :: Derivation
custom :: () => (a, DataDecl) -> [Decl ()] -> [Decl ()]

-- | Derive Uniplate and Biplate using the Direct combinators. You must
--   request monomorphic instances, i.e:
--   
--   
--   data Foo a = Foo a (Bool, a)
--   
--   {-!
--   deriving instance UniplateDirect (Foo Int)
--   deriving instance UniplateDirect (Bool, Int) Int
--   deriving instance UniplateDirect (Foo Int) Int
--   !-}
--   
--   
--   This will generate the instances Uniplate (Foo Int),
--   Biplate (Bool, Int) Int and Biplate (Foo Int) Int.
--   Generally, start with the instance you are after (e.g.
--   UniplateDirect (Foo Int)), try to compile and add further
--   instances as necessary. UniplateDirect with one argument
--   derives Uniplate, and with two arguments derives Biplate.
--   
--   deriving UniplateDirect on a data type with no arguments
--   derives Uniplate with all type parameters defaulting to ().
module Data.Derive.UniplateDirect
makeUniplateDirect :: Derivation
instance GHC.Classes.Eq Data.Derive.UniplateDirect.Ans
instance GHC.Show.Show Data.Derive.UniplateDirect.Ans

-- | A pseudo derivation. For each field in the data type, deriving
--   Set generates setFieldName v x =
--   x{fieldName = v}. This derivation is intended to
--   work around the fact that in Haskell assigning to a field is not a
--   first class object (although extracting from a field is).
module Data.Derive.Set
makeSet :: Derivation

module Data.Derive.Serialize
makeSerialize :: Derivation
dslSerialize :: DSL

module Data.Derive.Serial
makeSerial :: Derivation
dslSerial :: DSL

-- | A pseudo derivation. For each field in the data type, deriving
--   Ref generates refFieldName = Ref { select
--   = fieldName , update = f v -> v {
--   fieldName = f (fieldName v) } }.
--   
--   This is intended for use with the compositional functional references
--   described in
--   http://www.haskell.org/pipermail/haskell-cafe/2007-June/026477.html.
module Data.Derive.Ref
makeRef :: Derivation

module Data.Derive.NFData
makeNFData :: Derivation
dslNFData :: DSL

-- | Derives an instance of Monoid. It uses the product
--   construction of monoids. mappend on two different
--   constructors is undefined.
module Data.Derive.Monoid
makeMonoid :: Derivation

-- | A pseudo derivation. For each field in the data type, deriving
--   Lens generates lensFieldName = lens
--   fieldName ( x v -> v { fieldName =
--   x }).
--   
--   This works with the data-lens package.
module Data.Derive.Lens
makeLens :: Derivation

-- | A pseudo derivation. For each field in the data type, deriving
--   LazySet generates a function like a record updator, but lazy
--   where possible. This is very useful in certain situations to improve
--   laziness properties. A setter is only lazy if that field is present in
--   one constructor.
module Data.Derive.LazySet
makeLazySet :: Derivation

-- | Derive JSON instances.
--   
--   Unlike Text.JSON.Generics, single constructor types are not
--   handled specially. Every value is encoded as an object with a single
--   field, with the constructor name as key and the values as its
--   contents.
--   
--   If the constructor is a record, the contents is an Object with the
--   field names as keys. Otherwise, the contents is an array.
module Data.Derive.JSON

-- | Derivation for JSON
makeJSON :: Derivation

module Data.Derive.Is
makeIs :: Derivation

-- | Has is a pseudo derivation. For each field of any constructor of the
--   data type, Has generates hasFieldName which returns
--   True if given the the given field is a member of the
--   constructor of the passed object, and False otherwise.
module Data.Derive.Has
makeHas :: Derivation

-- | A pseudo derivation. For each constructor in the data type, deriving
--   From generates fromCtorName which extracts
--   the components if given the appropriate constructor, and crashes
--   otherwise. Unlike the DrIFT "From" derivation, our version
--   works for all constructors - zero-arity constructors always return
--   (), arity-one constructors return the contained value, and
--   all others return a tuple with all the components.
module Data.Derive.From
makeFrom :: Derivation

-- | A pseudo derivation. Derive a (non-recursive) fold function for the
--   type which takes one function per alternative constructor. Each
--   function takes the same arguments as the constructor and returns a
--   value. When applied to a value the fold function applies the function
--   for the matching constructor to the constructor fields. This provides
--   a first-class alternative to pattern matching to deconstruct the data
--   type.
module Data.Derive.Fold
makeFold :: Derivation

module Data.Derive.EnumCyclic
makeEnumCyclic :: Derivation
dslEnumCyclic :: DSL

module Data.Derive.Default
makeDefault :: Derivation
dslDefault :: DSL

-- | For deriving Data on abstract data types.
module Data.Derive.DataAbstract
makeDataAbstract :: Derivation

module Data.Derive.Bounded
makeBounded :: Derivation
dslBounded :: DSL

module Data.Derive.BinaryDefer
makeBinaryDefer :: Derivation
dslBinaryDefer :: DSL

module Data.Derive.Binary
makeBinary :: Derivation
dslBinary :: DSL

module Data.Derive.Arities
makeArities :: Derivation
dslArities :: DSL

module Data.Derive.ArbitraryOld
makeArbitraryOld :: Derivation
dslArbitraryOld :: DSL

module Data.Derive.Arbitrary
makeArbitrary :: Derivation

-- | This module provides convenience re-exports of all the standard
--   Data.Derive derivations.
module Data.Derive.All
data Derivation
derivations :: [Derivation]

-- | Use this module to create your own derive program, supporting custom
--   derivations. As an example:
--   
--   
--   import Data.DeriveMain        (deriveMain)
--   import Data.Derive.All        (derivations)
--   import MyProject.MyDerivation (myDerivation)
--   
--   
--   
--   main :: IO
--   main = deriveMain $ [myDerivation] ++ derivations
--   
module Data.DeriveMain
deriveMain :: [Derivation] -> IO ()

-- | Compatibility definitions to paper over differences between 6.10 and
--   6.12.
module Language.Haskell.TH.Compat
fromTyVar :: TyVarBndr -> Name
instanceD :: Cxt -> Type -> [Dec] -> Dec
dataDefinitionTypeArgs :: Dec -> [Name]
from_deriv_clause :: DerivClause -> [Name]
from_cxt :: Type -> Name
typeToPred :: Type -> Type

module Language.Haskell.Convert
class (Typeable a, Typeable b, Show a, Show b) => Convert a b
convert :: forall a b. Convert a b => a -> b
instance Language.Haskell.Convert.Convert a b => Language.Haskell.Convert.Convert [a] [b]
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Dec (Language.Haskell.Exts.Syntax.Decl ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Cxt (Language.Haskell.Exts.Syntax.Context ())
instance Language.Haskell.Convert.Convert (GHC.Maybe.Maybe (Language.Haskell.Exts.Syntax.Context ())) Language.Haskell.TH.Syntax.Cxt
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Name (Language.Haskell.Exts.Syntax.TyVarBind ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Name (Language.Haskell.Exts.Syntax.Name ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Name (Language.Haskell.Exts.Syntax.QName ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Con (Language.Haskell.Exts.Syntax.QualConDecl ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Con (Language.Haskell.Exts.Syntax.ConDecl ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.StrictType (Language.Haskell.Exts.Syntax.Type ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Type (Language.Haskell.Exts.Syntax.Type ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Type (Language.Haskell.Exts.Syntax.Asst ())
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Decl ()) Language.Haskell.TH.Syntax.Dec
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.QualConDecl ()) Language.Haskell.TH.Syntax.Con
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.ConDecl ()) Language.Haskell.TH.Syntax.Con
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.FieldDecl ()) [Language.Haskell.TH.Syntax.VarStrictType]
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Type ()) Language.Haskell.TH.Syntax.StrictType
instance Language.Haskell.Convert.Convert ([Language.Haskell.Exts.Syntax.Name ()], Language.Haskell.Exts.Syntax.Type ()) [Language.Haskell.TH.Syntax.VarStrictType]
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Asst ()) Language.Haskell.TH.Syntax.Type
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Type ()) Language.Haskell.TH.Syntax.Type
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Name ()) Language.Haskell.TH.Syntax.Name
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Match ()) Language.Haskell.TH.Syntax.Clause
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Rhs ()) Language.Haskell.TH.Syntax.Body
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Exp ()) Language.Haskell.TH.Syntax.Exp
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.GuardedRhs ()) (Language.Haskell.TH.Syntax.Guard, Language.Haskell.TH.Syntax.Exp)
instance Language.Haskell.Convert.Convert [Language.Haskell.Exts.Syntax.Stmt ()] Language.Haskell.TH.Syntax.Guard
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Binds ()) [Language.Haskell.TH.Syntax.Dec]
instance Language.Haskell.Convert.Convert (GHC.Maybe.Maybe (Language.Haskell.Exts.Syntax.Binds ())) [Language.Haskell.TH.Syntax.Dec]
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Pat ()) Language.Haskell.TH.Syntax.Pat
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Literal ()) Language.Haskell.TH.Syntax.Lit
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.QName ()) Language.Haskell.TH.Syntax.Name
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.PatField ()) Language.Haskell.TH.Syntax.FieldPat
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.QOp ()) Language.Haskell.TH.Syntax.Exp
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Alt ()) Language.Haskell.TH.Syntax.Match
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Stmt ()) Language.Haskell.TH.Syntax.Stmt
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.QualStmt ()) Language.Haskell.TH.Syntax.Stmt
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.FieldUpdate ()) Language.Haskell.TH.Syntax.FieldExp
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.TyVarBind ()) Language.Haskell.TH.Syntax.Name
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.TyVarBndr (Language.Haskell.Exts.Syntax.TyVarBind ())
instance Language.Haskell.Convert.Convert Language.Haskell.TH.Syntax.Kind (Language.Haskell.Exts.Syntax.Kind ())
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.TyVarBind ()) Language.Haskell.TH.Syntax.TyVarBndr
instance Language.Haskell.Convert.Convert (Language.Haskell.Exts.Syntax.Kind ()) Language.Haskell.TH.Syntax.Kind

-- | The core module of the Data.Derive system. This module contains the
--   data types used for communication between the extractors and the
--   derivors.
module Language.Haskell.TH.Data
type DataDef = Dec
type CtorDef = Con
dataName :: DataDef -> String
qualifiedDataName :: DataDef -> Name
dataArity :: DataDef -> Int
dataArgs :: DataDef -> [Name]
dataCtors :: DataDef -> [CtorDef]
ctorName :: CtorDef -> String
qualifiedCtorName :: CtorDef -> Name
ctorArity :: CtorDef -> Int
ctorStrictTypes :: CtorDef -> [StrictType]
ctorTypes :: CtorDef -> [Type]
ctorFields :: CtorDef -> [String]
dropModule :: String -> String
dropNumber :: String -> String
normData :: DataDef -> DataDef
unqualifiedName :: Name -> String
typeApp :: Type -> (Type, [Type])
eqConT :: String -> Type -> Bool
isTupleT :: Type -> Bool

-- | Expand type synonyms in data declarations.
--   
--   This is needed for some type based derivations.
module Language.Haskell.TH.ExpandSynonym

-- | Expand type synonyms in a data declaration
expandData :: DataDef -> Q DataDef

-- | These small short-named functions are intended to make the
--   construction of abstranct syntax trees less tedious.
module Language.Haskell.TH.Helper
applyWith :: Exp -> [Exp] -> Exp
foldl1With :: Exp -> [Exp] -> Exp
foldr1With :: Exp -> [Exp] -> Exp

-- | A simple clause, without where or guards.
sclause :: [Pat] -> Exp -> Clause

-- | A default clause with N arguments.
defclause :: Int -> Exp -> Clause

-- | A simple Val clause
sval :: Pat -> Exp -> Dec
case' :: Exp -> [(Pat, Exp)] -> Exp
(->:) :: String -> Exp -> Exp

-- | We provide 3 standard instance constructors instance_default requires
--   C for each free type variable instance_none requires no context
--   instance_context requires a given context
instance_none :: String -> DataDef -> [Dec] -> Dec
instance_default :: String -> DataDef -> [Dec] -> Dec
instance_context :: [String] -> String -> DataDef -> [Dec] -> Dec

-- | Build an instance of a class for a data type, using the heuristic that
--   the type is itself required on all type arguments.
simple_instance :: String -> DataDef -> [Dec] -> [Dec]

-- | Build an instance of a class for a data type, using the class at the
--   given types
generic_instance :: String -> DataDef -> [Type] -> [Dec] -> [Dec]

-- | Build a type signature declaration with a string name
sigN :: String -> Type -> Dec

-- | Build a fundecl with a string name
funN :: String -> [Clause] -> Dec
class Eq nm => NameLike nm
toName :: NameLike nm => nm -> Name

-- | The class used to overload lifting operations. To reduce code
--   duplication, we overload the wrapped constructors (and everything
--   else, but that's irrelevant) to work in patterns, expressions, and
--   types.
class Valcon a

-- | Build an application node, with a name for a head and a provided list
--   of arguments.
lK :: (Valcon a, NameLike nm) => nm -> [a] -> a

-- | Reference a named variable.
vr :: (Valcon a, NameLike nm) => nm -> a

-- | Lift a TH Lit
raw_lit :: Valcon a => Lit -> a

-- | Tupling
tup :: Valcon a => [a] -> a

-- | Listing
lst :: Valcon a => [a] -> a

-- | Build an application node without a given head
app :: Exp -> [Exp] -> Exp

-- | This class is used to overload literal construction based on the type
--   of the literal.
class LitC a
lit :: (LitC a, Valcon p) => a -> p
dataVars :: DataDef -> [Type]

-- | Common pattern: list of a familiy of variables
vars :: Valcon a => Char -> Int -> [a]

-- | Variable based on a letter + number
vrn :: Valcon a => Char -> Int -> a

-- | Make a list of variables, one for each argument to a constructor
ctv :: Valcon a => CtorDef -> Char -> [a]

-- | Make a simple pattern to bind a constructor
ctp :: Valcon a => CtorDef -> Char -> a

-- | Reference the constructor itself
ctc :: Valcon a => CtorDef -> a
l0 :: (NameLike nm, Valcon a) => nm -> a
l1 :: (NameLike nm, Valcon a) => nm -> a -> a
l2 :: (NameLike nm, Valcon a) => nm -> a -> a -> a
true :: Valcon a => a
false :: Valcon a => a
nil :: Valcon a => a
hNil' :: Type
hZero' :: Type
unit :: Exp
id' :: Exp
cons :: Valcon a => a -> a -> a
box :: Valcon a => a -> a
return' :: Exp -> Exp
const' :: Exp -> Exp
hSucc' :: Type -> Type
(==:) :: Exp -> Exp -> Exp
(&&:) :: Exp -> Exp -> Exp
(++:) :: Exp -> Exp -> Exp
(>>=:) :: Exp -> Exp -> Exp
(>>:) :: Exp -> Exp -> Exp
(.:) :: Exp -> Exp -> Exp
ap' :: Exp -> Exp -> Exp
(>:) :: Exp -> Exp -> Exp
hCons' :: Type -> Type -> Type

-- | Build a chain of expressions, with an appropriate terminal sequence__
--   does not require a unit at the end (all others are optimised
--   automatically)
(&&::) :: [Exp] -> Exp

-- | Build a chain of expressions, with an appropriate terminal sequence__
--   does not require a unit at the end (all others are optimised
--   automatically)
(++::) :: [Exp] -> Exp

-- | Build a chain of expressions, with an appropriate terminal sequence__
--   does not require a unit at the end (all others are optimised
--   automatically)
(>>::) :: [Exp] -> Exp

-- | Build a chain of expressions, with an appropriate terminal sequence__
--   does not require a unit at the end (all others are optimised
--   automatically)
sequence__ :: [Exp] -> Exp

-- | Build a chain of expressions, with an appropriate terminal sequence__
--   does not require a unit at the end (all others are optimised
--   automatically)
(.::) :: [Exp] -> Exp

-- | K-way liftM
liftmk :: Exp -> [Exp] -> Exp
instance Language.Haskell.TH.Helper.LitC GHC.Integer.Type.Integer
instance Language.Haskell.TH.Helper.LitC GHC.Types.Char
instance Language.Haskell.TH.Helper.LitC a => Language.Haskell.TH.Helper.LitC [a]
instance (Language.Haskell.TH.Helper.LitC a, Language.Haskell.TH.Helper.LitC b) => Language.Haskell.TH.Helper.LitC (a, b)
instance (Language.Haskell.TH.Helper.LitC a, Language.Haskell.TH.Helper.LitC b, Language.Haskell.TH.Helper.LitC c) => Language.Haskell.TH.Helper.LitC (a, b, c)
instance Language.Haskell.TH.Helper.LitC ()
instance Language.Haskell.TH.Helper.Valcon Language.Haskell.TH.Syntax.Exp
instance Language.Haskell.TH.Helper.Valcon Language.Haskell.TH.Syntax.Pat
instance Language.Haskell.TH.Helper.Valcon Language.Haskell.TH.Syntax.Type
instance Language.Haskell.TH.Helper.NameLike Language.Haskell.TH.Syntax.Name
instance Language.Haskell.TH.Helper.NameLike GHC.Base.String

module Language.Haskell.TH.Peephole
peephole :: Data a => a -> a
replaceVar :: Name -> Exp -> Exp -> Exp
replaceVars :: [(Name, Exp)] -> Exp -> Exp

module Language.Haskell.TH.All

-- | The type of ways to derive classes. Should not really be in this
--   module!
data Derivation
Derivation :: (DataDef -> Q [Dec]) -> String -> Derivation

-- | The derivation function proper
[derivationDeriver] :: Derivation -> DataDef -> Q [Dec]

-- | The name of the derivation
[derivationName] :: Derivation -> String
derivation :: (DataDef -> [Dec]) -> String -> Derivation
derivationQ :: (DataDef -> Q [Dec]) -> String -> Derivation

-- | The main TH driver module. It is intended that this need be the only
--   module imported by user code; it takes care of all data threading
--   issues such that all one needs to do is:
--   
--   
--   data Foo = Foo ; $( derive makeEq ''Foo )
--   
module Data.DeriveTH

-- | Derive an instance of some class. derive only derives
--   instances for the type of the argument.
derive :: Derivation -> Name -> Q [Dec]
derives :: [Derivation] -> [Name] -> Q [Dec]

-- | Derive an instance of some class. deriveFromDec only derives
--   instances for the type of the argument.
deriveFromDec :: Derivation -> Dec -> Q [Dec]
