-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer -- -- Haskell-Source with Extensions (HSE, haskell-src-exts) is an extension -- of the standard haskell-src package, and handles most common syntactic -- extensions to Haskell, including: -- -- -- -- and a few more. Apart from these standard extensions, it also handles -- regular patterns as per the HaRP extension as well as HSX-style -- embedded XML syntax. -- -- For details on usage, please see the website. @package haskell-src-exts @version 0.4.8 -- | A suite of datatypes describing the abstract syntax of Haskell 98 -- http://www.haskell.org/onlinereport/ plus some extensions: -- -- -- -- Also worth noting is that (n+k) patterns from Haskell 98 are not -- supported module Language.Haskell.Exts.Syntax -- | A Haskell source module. data Module Module :: SrcLoc -> ModuleName -> [OptionPragma] -> (Maybe WarningText) -> (Maybe [ExportSpec]) -> [ImportDecl] -> [Decl] -> Module -- | Export specification. data ExportSpec -- | variable EVar :: QName -> ExportSpec -- | T: a class or datatype exported abstractly, or a type -- synonym. EAbs :: QName -> ExportSpec -- | T(..): a class exported with all of its methods, or a -- datatype exported with all of its constructors. EThingAll :: QName -> ExportSpec -- | T(C_1,...,C_n): a class exported with some of its methods, or -- a datatype exported with some of its constructors. EThingWith :: QName -> [CName] -> ExportSpec -- | module M: re-export a module. EModuleContents :: ModuleName -> ExportSpec -- | Import declaration. data ImportDecl ImportDecl :: SrcLoc -> ModuleName -> Bool -> Bool -> Maybe ModuleName -> Maybe (Bool, [ImportSpec]) -> ImportDecl -- | position of the import keyword. importLoc :: ImportDecl -> SrcLoc -- | name of the module imported. importModule :: ImportDecl -> ModuleName -- | imported qualified? importQualified :: ImportDecl -> Bool -- | imported with {--} importSrc :: ImportDecl -> Bool -- | optional alias name in an as clause. importAs :: ImportDecl -> Maybe ModuleName -- | optional list of import specifications. The Bool is True -- if the names are excluded by hiding. importSpecs :: ImportDecl -> Maybe (Bool, [ImportSpec]) -- | Import specification. data ImportSpec -- | variable IVar :: Name -> ImportSpec -- | T: the name of a class, datatype or type synonym. IAbs :: Name -> ImportSpec -- | T(..): a class imported with all of its methods, or a -- datatype imported with all of its constructors. IThingAll :: Name -> ImportSpec -- | T(C_1,...,C_n): a class imported with some of its methods, or -- a datatype imported with some of its constructors. IThingWith :: Name -> [CName] -> ImportSpec -- | Associativity of an operator. data Assoc -- | non-associative operator (declared with infix) AssocNone :: Assoc -- | left-associative operator (declared with infixl). AssocLeft :: Assoc -- | right-associative operator (declared with infixr) AssocRight :: Assoc data Decl TypeDecl :: SrcLoc -> Name -> [Name] -> Type -> Decl DataDecl :: SrcLoc -> DataOrNew -> Context -> Name -> [Name] -> [QualConDecl] -> [Deriving] -> Decl GDataDecl :: SrcLoc -> DataOrNew -> Context -> Name -> [Name] -> (Maybe Kind) -> [GadtDecl] -> [Deriving] -> Decl TypeFamDecl :: SrcLoc -> Name -> [Name] -> (Maybe Kind) -> Decl DataFamDecl :: SrcLoc -> Context -> Name -> [Name] -> (Maybe Kind) -> Decl TypeInsDecl :: SrcLoc -> Type -> Type -> Decl DataInsDecl :: SrcLoc -> DataOrNew -> Type -> [QualConDecl] -> [Deriving] -> Decl GDataInsDecl :: SrcLoc -> DataOrNew -> Type -> (Maybe Kind) -> [GadtDecl] -> [Deriving] -> Decl InfixDecl :: SrcLoc -> Assoc -> Int -> [Op] -> Decl ClassDecl :: SrcLoc -> Context -> Name -> [Name] -> [FunDep] -> [ClassDecl] -> Decl InstDecl :: SrcLoc -> Context -> QName -> [Type] -> [InstDecl] -> Decl DerivDecl :: SrcLoc -> Context -> QName -> [Type] -> Decl DefaultDecl :: SrcLoc -> [Type] -> Decl SpliceDecl :: SrcLoc -> Splice -> Decl TypeSig :: SrcLoc -> [Name] -> Type -> Decl FunBind :: [Match] -> Decl PatBind :: SrcLoc -> Pat -> (Maybe Type) -> Rhs -> Binds -> Decl ForImp :: SrcLoc -> CallConv -> Safety -> String -> Name -> Type -> Decl ForExp :: SrcLoc -> CallConv -> String -> Name -> Type -> Decl RulePragmaDecl :: SrcLoc -> [Rule] -> Decl DeprPragmaDecl :: SrcLoc -> [([Name], String)] -> Decl WarnPragmaDecl :: SrcLoc -> [([Name], String)] -> Decl InlineSig :: SrcLoc -> Bool -> Activation -> QName -> Decl SpecSig :: SrcLoc -> QName -> [Type] -> Decl SpecInlineSig :: SrcLoc -> Bool -> Activation -> QName -> [Type] -> Decl InstSig :: SrcLoc -> Context -> QName -> [Type] -> Decl UnknownDeclPragma :: SrcLoc -> String -> String -> Decl data Binds BDecls :: [Decl] -> Binds IPBinds :: [IPBind] -> Binds data IPBind IPBind :: SrcLoc -> IPName -> Exp -> IPBind -- | Declarations inside a class declaration data ClassDecl ClsDecl :: Decl -> ClassDecl ClsDataFam :: SrcLoc -> Context -> Name -> [Name] -> (Maybe Kind) -> ClassDecl ClsTyFam :: SrcLoc -> Name -> [Name] -> (Maybe Kind) -> ClassDecl ClsTyDef :: SrcLoc -> Type -> Type -> ClassDecl -- | Declarations inside an instance declaration data InstDecl InsDecl :: Decl -> InstDecl InsType :: SrcLoc -> Type -> Type -> InstDecl InsData :: SrcLoc -> DataOrNew -> Type -> [QualConDecl] -> [Deriving] -> InstDecl InsGData :: SrcLoc -> DataOrNew -> Type -> (Maybe Kind) -> [GadtDecl] -> [Deriving] -> InstDecl InsInline :: SrcLoc -> Bool -> Activation -> QName -> InstDecl type Deriving = (QName, [QName]) data GadtDecl GadtDecl :: SrcLoc -> Name -> Type -> GadtDecl -- | Declaration of a data constructor. data ConDecl -- | ordinary data constructor ConDecl :: Name -> [BangType] -> ConDecl -- | record constructor RecDecl :: Name -> [([Name], BangType)] -> ConDecl data QualConDecl QualConDecl :: SrcLoc -> [TyVarBind] -> Context -> ConDecl -> QualConDecl -- | The type of a constructor argument or field, optionally including a -- strictness annotation. data BangType -- | strict component, marked with "!" BangedTy :: Type -> BangType -- | non-strict component UnBangedTy :: Type -> BangType -- | unboxed component UnpackedTy :: Type -> BangType -- | Clauses of a function binding. data Match Match :: SrcLoc -> Name -> [Pat] -> (Maybe Type) -> Rhs -> Binds -> Match -- | The right hand side of a function or pattern binding. data Rhs -- | unguarded right hand side (exp) UnGuardedRhs :: Exp -> Rhs -- | guarded right hand side (gdrhs) GuardedRhss :: [GuardedRhs] -> Rhs -- | A guarded right hand side | exp = exp. -- The first expression will be Boolean-valued. data GuardedRhs GuardedRhs :: SrcLoc -> [Stmt] -> Exp -> GuardedRhs data DataOrNew DataType :: DataOrNew NewType :: DataOrNew type Context = [Asst] -- | A functional dependency, given on the form l1 l2 ... ln -> r2 r3 .. -- rn data FunDep FunDep :: [Name] -> [Name] -> FunDep -- | 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 ClassA :: QName -> [Type] -> Asst IParam :: IPName -> Type -> Asst EqualP :: Type -> Type -> Asst -- | A type qualified with a context. An unqualified type has an empty -- context. data Type TyForall :: (Maybe [TyVarBind]) -> Context -> Type -> Type -- | function type TyFun :: Type -> Type -> Type -- | tuple type, possibly boxed TyTuple :: Boxed -> [Type] -> Type -- | application of a type constructor TyApp :: Type -> Type -> Type -- | type variable TyVar :: Name -> Type -- | named type or type constructor TyCon :: QName -> Type -- | assertion of an implicit parameter TyPred :: Asst -> Type -- | infix type constructor TyInfix :: Type -> QName -> Type -> Type -- | type with explicit kind signature TyKind :: Type -> Kind -> Type data Boxed Boxed :: Boxed Unboxed :: Boxed data Kind KindStar :: Kind KindBang :: Kind KindFn :: Kind -> Kind -> Kind data TyVarBind KindedVar :: Name -> Kind -> TyVarBind UnkindedVar :: Name -> TyVarBind -- | Haskell expressions. -- -- Notes: -- -- data Exp -- | variable Var :: QName -> Exp -- | implicit parameter variable IPVar :: IPName -> Exp -- | data constructor Con :: QName -> Exp -- | literal constant Lit :: Literal -> Exp -- | infix application InfixApp :: Exp -> QOp -> Exp -> Exp -- | ordinary application App :: Exp -> Exp -> Exp -- | negation expression - exp NegApp :: Exp -> Exp -- | lambda expression Lambda :: SrcLoc -> [Pat] -> Exp -> Exp -- | local declarations with let Let :: Binds -> Exp -> Exp -- | if exp then exp else -- exp If :: Exp -> Exp -> Exp -> Exp -- | case exp of alts Case :: Exp -> [Alt] -> Exp -- | do-expression: the last statement in the list should be an -- expression. Do :: [Stmt] -> Exp -- | mdo-expression MDo :: [Stmt] -> Exp -- | tuple expression Tuple :: [Exp] -> Exp -- | list expression List :: [Exp] -> Exp -- | parenthesized expression Paren :: Exp -> Exp -- | left section (exp qop) LeftSection :: Exp -> QOp -> Exp -- | right section (qop exp) RightSection :: QOp -> Exp -> Exp -- | record construction expression RecConstr :: QName -> [FieldUpdate] -> Exp -- | record update expression RecUpdate :: Exp -> [FieldUpdate] -> Exp -- | unbounded arithmetic sequence, incrementing by 1 EnumFrom :: Exp -> Exp -- | bounded arithmetic sequence, incrementing by 1 EnumFromTo :: Exp -> Exp -> Exp -- | unbounded arithmetic sequence, with first two elements given EnumFromThen :: Exp -> Exp -> Exp -- | bounded arithmetic sequence, with first two elements given EnumFromThenTo :: Exp -> Exp -> Exp -> Exp -- | list comprehension ListComp :: Exp -> [Stmt] -> Exp -- | expression type signature Template Haskell ExpTypeSig :: SrcLoc -> Exp -> Type -> Exp -- | 'x VarQuote :: QName -> Exp -- | ''T TypQuote :: QName -> Exp BracketExp :: Bracket -> Exp SpliceExp :: Splice -> Exp XTag :: SrcLoc -> XName -> [XAttr] -> (Maybe Exp) -> [Exp] -> Exp XETag :: SrcLoc -> XName -> [XAttr] -> (Maybe Exp) -> Exp XPcdata :: String -> Exp XExpTag :: Exp -> Exp CorePragma :: String -> Exp SCCPragma :: String -> Exp GenPragma :: String -> (Int, Int) -> (Int, Int) -> Exp UnknownExpPragma :: String -> String -> Exp -- | This type represents both stmt in a do-expression, and -- qual in a list comprehension, as well as stmt in a -- pattern guard. data Stmt -- | a generator pat <- exp Generator :: SrcLoc -> Pat -> Exp -> Stmt -- | an exp by itself: in a do-expression, an action whose -- result is discarded; in a list comprehension, a guard expression Qualifier :: Exp -> Stmt -- | local bindings LetStmt :: Binds -> Stmt -- | An fbind in a labeled construction or update. data FieldUpdate FieldUpdate :: QName -> Exp -> FieldUpdate FieldPun :: Name -> FieldUpdate FieldWildcard :: FieldUpdate -- | An alt in a case expression. data Alt Alt :: SrcLoc -> Pat -> GuardedAlts -> Binds -> Alt data GuardedAlts -- | -> exp UnGuardedAlt :: Exp -> GuardedAlts -- | gdpat GuardedAlts :: [GuardedAlt] -> GuardedAlts -- | A guarded alternative | stmt, ... , stmt -- -> exp. data GuardedAlt GuardedAlt :: SrcLoc -> [Stmt] -> Exp -> GuardedAlt -- | A pattern, to be matched against a value. data Pat -- | variable PVar :: Name -> Pat -- | literal constant PLit :: Literal -> Pat -- | negated pattern PNeg :: Pat -> Pat -- | n+k pattern PNPlusK :: Name -> Integer -> Pat -- | pattern with infix data constructor PInfixApp :: Pat -> QName -> Pat -> Pat -- | data constructor and argument patterns PApp :: QName -> [Pat] -> Pat -- | tuple pattern PTuple :: [Pat] -> Pat -- | list pattern PList :: [Pat] -> Pat -- | parenthesized pattern PParen :: Pat -> Pat -- | labelled pattern PRec :: QName -> [PatField] -> Pat -- | @-pattern PAsPat :: Name -> Pat -> Pat -- | wildcard pattern (_) PWildCard :: Pat -- | irrefutable pattern (~) PIrrPat :: Pat -> Pat -- | pattern type signature PatTypeSig :: SrcLoc -> Pat -> Type -> Pat -- | view patterns of the form (e -> p) HaRP PViewPat :: Exp -> Pat -> Pat -- | regular pattern (HaRP) Hsx PRPat :: [RPat] -> Pat -- | XML tag pattern PXTag :: SrcLoc -> XName -> [PXAttr] -> (Maybe Pat) -> [Pat] -> Pat -- | XML singleton tag pattern PXETag :: SrcLoc -> XName -> [PXAttr] -> (Maybe Pat) -> Pat -- | XML PCDATA pattern PXPcdata :: String -> Pat -- | XML embedded pattern PXPatTag :: Pat -> Pat -- | XML regular list pattern PXRPats :: [RPat] -> Pat -- | An fpat in a labeled record pattern. data PatField PFieldPat :: QName -> Pat -> PatField PFieldPun :: Name -> PatField PFieldWildcard :: PatField -- | literal Values of this type hold the abstract value of the -- literal, not the precise string representation used. For example, -- 10, 0o12 and 0xa have the same -- representation. data Literal -- | character literal Char :: Char -> Literal -- | string literal String :: String -> Literal -- | integer literal Int :: Integer -> Literal -- | floating point literal Frac :: Rational -> Literal -- | GHC unboxed integer literal PrimInt :: Integer -> Literal -- | GHC unboxed word literal PrimWord :: Integer -> Literal -- | GHC unboxed float literal PrimFloat :: Rational -> Literal -- | GHC unboxed double literal PrimDouble :: Rational -> Literal -- | GHC unboxed character literal PrimChar :: Char -> Literal -- | GHC unboxed string literal PrimString :: String -> Literal -- | The name of a Haskell module. newtype ModuleName ModuleName :: String -> ModuleName -- | This type is used to represent qualified variables, and also qualified -- constructors. data QName -- | name qualified with a module name Qual :: ModuleName -> Name -> QName -- | unqualified name UnQual :: Name -> QName -- | built-in constructor with special syntax Special :: SpecialCon -> QName -- | This type is used to represent variables, and also constructors. data Name -- | varid or conid. Ident :: String -> Name -- | varsym or consym Symbol :: String -> Name -- | Possibly qualified infix operators (qop), appearing in -- expressions. data QOp -- | variable operator (qvarop) QVarOp :: QName -> QOp -- | constructor operator (qconop) QConOp :: QName -> QOp -- | Operators, appearing in infix declarations. data Op -- | variable operator (varop) VarOp :: Name -> Op -- | constructor operator (conop) ConOp :: Name -> Op -- | Constructors with special syntax. These names are never qualified, and -- always refer to builtin type or data constructors. data SpecialCon -- | unit type and data constructor () UnitCon :: SpecialCon -- | list type constructor [] ListCon :: SpecialCon -- | function type constructor -> FunCon :: SpecialCon -- | n-ary tuple type and data constructors (,) etc TupleCon :: Int -> SpecialCon -- | list data constructor (:) Cons :: SpecialCon -- | A name (cname) of a component of a class or data type in an -- import or export specification. data CName -- | name of a method or field VarName :: Name -> CName -- | name of a data constructor ConName :: Name -> CName -- | This type is used to represent implicit parameter names. data IPName IPDup :: String -> IPName IPLin :: String -> IPName data Bracket ExpBracket :: Exp -> Bracket PatBracket :: Pat -> Bracket TypeBracket :: Type -> Bracket DeclBracket :: [Decl] -> Bracket data Splice IdSplice :: String -> Splice ParenSplice :: Exp -> Splice -- | An entity in a regular pattern (HaRP) data RPat RPOp :: RPat -> RPatOp -> RPat RPEither :: RPat -> RPat -> RPat RPSeq :: [RPat] -> RPat RPGuard :: Pat -> [Stmt] -> RPat RPCAs :: Name -> RPat -> RPat RPAs :: Name -> RPat -> RPat RPParen :: RPat -> RPat RPPat :: Pat -> RPat -- | A regular pattern operator (HaRP) data RPatOp RPStar :: RPatOp RPStarG :: RPatOp RPPlus :: RPatOp RPPlusG :: RPatOp RPOpt :: RPatOp RPOptG :: RPatOp data XAttr XAttr :: XName -> Exp -> XAttr data XName XName :: String -> XName XDomName :: String -> String -> XName -- | An XML attribute in an XML tag pattern data PXAttr PXAttr :: XName -> Pat -> PXAttr data Safety PlayRisky :: Safety PlaySafe :: Bool -> Safety data CallConv StdCall :: CallConv CCall :: CallConv data OptionPragma LanguagePragma :: SrcLoc -> [Name] -> OptionPragma IncludePragma :: SrcLoc -> String -> OptionPragma CFilesPragma :: SrcLoc -> String -> OptionPragma OptionsPragma :: SrcLoc -> (Maybe Tool) -> String -> OptionPragma UnknownTopPragma :: SrcLoc -> String -> String -> OptionPragma data Tool GHC :: Tool HUGS :: Tool NHC98 :: Tool YHC :: Tool HADDOCK :: Tool UnknownTool :: String -> Tool data WarningText DeprText :: String -> WarningText WarnText :: String -> WarningText data Rule Rule :: String -> Activation -> (Maybe [RuleVar]) -> Exp -> Exp -> Rule data RuleVar RuleVar :: Name -> RuleVar TypedRuleVar :: Name -> Type -> RuleVar data Activation AlwaysActive :: Activation ActiveFrom :: Int -> Activation ActiveUntil :: Int -> Activation prelude_mod :: ModuleName main_mod :: ModuleName main_name :: Name unit_con_name :: QName tuple_con_name :: Int -> QName list_cons_name :: QName unit_con :: Exp tuple_con :: Int -> Exp as_name :: Name qualified_name :: Name hiding_name :: Name minus_name :: Name pling_name :: Name dot_name :: Name star_name :: Name export_name :: Name safe_name :: Name unsafe_name :: Name threadsafe_name :: Name stdcall_name :: Name ccall_name :: Name unit_tycon_name :: QName fun_tycon_name :: QName list_tycon_name :: QName tuple_tycon_name :: Int -> QName unit_tycon :: Type fun_tycon :: Type list_tycon :: Type tuple_tycon :: Int -> Type -- | A position in the source. data SrcLoc SrcLoc :: String -> Int -> Int -> SrcLoc srcFilename :: SrcLoc -> String srcLine :: SrcLoc -> Int srcColumn :: SrcLoc -> Int instance Typeable GuardedAlt instance Typeable GuardedAlts instance Typeable Alt instance Typeable FieldUpdate instance Typeable Stmt instance Typeable PatField instance Typeable RPat instance Typeable RPatOp instance Typeable PXAttr instance Typeable Pat instance Typeable WarningText instance Typeable RuleVar instance Typeable Rule instance Typeable Activation instance Typeable Tool instance Typeable OptionPragma instance Typeable CallConv instance Typeable Safety instance Typeable Splice instance Typeable Bracket instance Typeable XAttr instance Typeable XName instance Typeable Exp instance Typeable Literal instance Typeable Asst instance Typeable FunDep instance Typeable Kind instance Typeable TyVarBind instance Typeable Boxed instance Typeable Type instance Typeable GuardedRhs instance Typeable Rhs instance Typeable BangType instance Typeable InstDecl instance Typeable ClassDecl instance Typeable ConDecl instance Typeable GadtDecl instance Typeable QualConDecl instance Typeable Match instance Typeable IPBind instance Typeable Binds instance Typeable DataOrNew instance Typeable Decl instance Typeable Assoc instance Typeable ImportSpec instance Typeable ImportDecl instance Typeable ExportSpec instance Typeable Module instance Typeable CName instance Typeable Op instance Typeable QOp instance Typeable IPName instance Typeable Name instance Typeable QName instance Typeable SpecialCon instance Typeable ModuleName instance Typeable SrcLoc instance Eq GuardedAlt instance Show GuardedAlt instance Data GuardedAlt instance Eq GuardedAlts instance Show GuardedAlts instance Data GuardedAlts instance Eq Alt instance Show Alt instance Data Alt instance Eq FieldUpdate instance Show FieldUpdate instance Data FieldUpdate instance Eq Stmt instance Show Stmt instance Data Stmt instance Eq PatField instance Show PatField instance Data PatField instance Eq RPat instance Show RPat instance Data RPat instance Eq RPatOp instance Show RPatOp instance Data RPatOp instance Eq PXAttr instance Show PXAttr instance Data PXAttr instance Eq Pat instance Show Pat instance Data Pat instance Eq WarningText instance Show WarningText instance Data WarningText instance Eq RuleVar instance Show RuleVar instance Data RuleVar instance Eq Rule instance Show Rule instance Data Rule instance Eq Activation instance Show Activation instance Data Activation instance Eq Tool instance Show Tool instance Data Tool instance Eq OptionPragma instance Show OptionPragma instance Data OptionPragma instance Eq CallConv instance Show CallConv instance Data CallConv instance Eq Safety instance Show Safety instance Data Safety instance Eq Splice instance Show Splice instance Data Splice instance Eq Bracket instance Show Bracket instance Data Bracket instance Eq XAttr instance Show XAttr instance Data XAttr instance Eq XName instance Show XName instance Data XName instance Eq Exp instance Show Exp instance Data Exp instance Eq Literal instance Show Literal instance Data Literal instance Eq Asst instance Show Asst instance Data Asst instance Eq FunDep instance Show FunDep instance Data FunDep instance Eq Kind instance Show Kind instance Data Kind instance Eq TyVarBind instance Show TyVarBind instance Data TyVarBind instance Eq Boxed instance Show Boxed instance Data Boxed instance Eq Type instance Show Type instance Data Type instance Eq GuardedRhs instance Show GuardedRhs instance Data GuardedRhs instance Eq Rhs instance Show Rhs instance Data Rhs instance Eq BangType instance Show BangType instance Data BangType instance Eq InstDecl instance Show InstDecl instance Data InstDecl instance Eq ClassDecl instance Show ClassDecl instance Data ClassDecl instance Eq ConDecl instance Show ConDecl instance Data ConDecl instance Eq GadtDecl instance Show GadtDecl instance Data GadtDecl instance Eq QualConDecl instance Show QualConDecl instance Data QualConDecl instance Eq Match instance Show Match instance Data Match instance Eq IPBind instance Show IPBind instance Data IPBind instance Eq Binds instance Show Binds instance Data Binds instance Eq DataOrNew instance Show DataOrNew instance Data DataOrNew instance Eq Decl instance Show Decl instance Data Decl instance Eq Assoc instance Show Assoc instance Data Assoc instance Eq ImportSpec instance Show ImportSpec instance Data ImportSpec instance Eq ImportDecl instance Show ImportDecl instance Data ImportDecl instance Eq ExportSpec instance Show ExportSpec instance Data ExportSpec instance Show Module instance Data Module instance Eq CName instance Ord CName instance Show CName instance Data CName instance Eq Op instance Ord Op instance Show Op instance Data Op instance Eq QOp instance Ord QOp instance Show QOp instance Data QOp instance Eq IPName instance Ord IPName instance Show IPName instance Data IPName instance Eq Name instance Ord Name instance Show Name instance Data Name instance Eq QName instance Ord QName instance Show QName instance Data QName instance Eq SpecialCon instance Ord SpecialCon instance Show SpecialCon instance Data SpecialCon instance Eq ModuleName instance Ord ModuleName instance Show ModuleName instance Data ModuleName instance Eq SrcLoc instance Ord SrcLoc instance Show SrcLoc instance Data SrcLoc module Language.Haskell.Exts.Build name :: String -> Name sym :: String -> Name var :: Name -> Exp op :: Name -> QOp qvar :: ModuleName -> Name -> Exp pvar :: Name -> Pat app :: Exp -> Exp -> Exp infixApp :: Exp -> QOp -> Exp -> Exp appFun :: Exp -> [Exp] -> Exp pApp :: Name -> [Pat] -> Pat tuple :: [Exp] -> Exp pTuple :: [Pat] -> Pat varTuple :: [Name] -> Exp pvarTuple :: [Name] -> Pat function :: String -> Exp strE :: String -> Exp charE :: Char -> Exp intE :: Integer -> Exp strP :: String -> Pat charP :: Char -> Pat intP :: Integer -> Pat doE :: [Stmt] -> Exp lamE :: SrcLoc -> [Pat] -> Exp -> Exp letE :: [Decl] -> Exp -> Exp caseE :: Exp -> [Alt] -> Exp alt :: SrcLoc -> Pat -> Exp -> Alt altGW :: SrcLoc -> Pat -> [Stmt] -> Exp -> Binds -> Alt listE :: [Exp] -> Exp eList :: Exp peList :: Pat paren :: Exp -> Exp pParen :: Pat -> Pat qualStmt :: Exp -> Stmt genStmt :: SrcLoc -> Pat -> Exp -> Stmt letStmt :: [Decl] -> Stmt binds :: [Decl] -> Binds noBinds :: Binds wildcard :: Pat genNames :: String -> Int -> [Name] -- | A function with a single match sfun :: SrcLoc -> Name -> [Name] -> Rhs -> Binds -> Decl -- | A function with a single match, a single argument, no guards -- and no where declarations simpleFun :: SrcLoc -> Name -> Name -> Exp -> Decl -- | A pattern bind where the pattern is a variable, and where there are no -- guards and no 'where' clause. patBind :: SrcLoc -> Pat -> Exp -> Decl patBindWhere :: SrcLoc -> Pat -> Exp -> [Decl] -> Decl nameBind :: SrcLoc -> Name -> Exp -> Decl metaFunction :: String -> [Exp] -> Exp metaConPat :: String -> [Pat] -> Pat -- | Pretty printer for Haskell with extensions. module Language.Haskell.Exts.Pretty -- | Things that can be pretty-printed, including all the syntactic objects -- in Language.Haskell.Syntax. class Pretty a -- | pretty-print with a given style and mode. prettyPrintStyleMode :: (Pretty a) => Style -> PPHsMode -> a -> String -- | pretty-print with the default style and a given mode. prettyPrintWithMode :: (Pretty a) => PPHsMode -> a -> String -- | pretty-print with the default style and defaultMode. prettyPrint :: (Pretty a) => a -> String -- | A rendering style. data Style :: * Style :: Mode -> Int -> Float -> Style -- | The rendering mode mode :: Style -> Mode -- | Length of line, in chars lineLength :: Style -> Int -- | Ratio of ribbon length to line length ribbonsPerLine :: Style -> Float -- | The default style (mode=PageMode, lineLength=100, -- ribbonsPerLine=1.5). style :: Style -- | Rendering mode. data Mode :: * -- | Normal PageMode :: Mode -- | With zig-zag cuts ZigZagMode :: Mode -- | No indentation, infinitely long lines LeftMode :: Mode -- | All on one line OneLineMode :: Mode -- | Pretty-printing parameters. -- -- Note: the onsideIndent must be positive and less than -- all other indents. data PPHsMode PPHsMode :: Indent -> Indent -> Indent -> Indent -> Indent -> Indent -> Bool -> PPLayout -> Bool -> Bool -> PPHsMode -- | indentation of a class or instance classIndent :: PPHsMode -> Indent -- | indentation of a do-expression doIndent :: PPHsMode -> Indent -- | indentation of the body of a case expression caseIndent :: PPHsMode -> Indent -- | indentation of the declarations in a let expression letIndent :: PPHsMode -> Indent -- | indentation of the declarations in a where clause whereIndent :: PPHsMode -> Indent -- | indentation added for continuation lines that would otherwise be -- offside onsideIndent :: PPHsMode -> Indent -- | blank lines between statements? spacing :: PPHsMode -> Bool -- | Pretty-printing style to use layout :: PPHsMode -> PPLayout -- | add GHC-style LINE pragmas to output? linePragmas :: PPHsMode -> Bool -- | not implemented yet comments :: PPHsMode -> Bool type Indent = Int -- | Varieties of layout we can use. data PPLayout -- | classical layout PPOffsideRule :: PPLayout -- | classical layout made explicit PPSemiColon :: PPLayout -- | inline decls, with newlines between them PPInLine :: PPLayout -- | everything on a single line PPNoLayout :: PPLayout -- | The default mode: pretty-print using the offside rule and sensible -- defaults. defaultMode :: PPHsMode instance Eq PPLayout instance Pretty SrcLoc instance Pretty Asst instance Pretty CName instance Pretty IPBind instance Pretty IPName instance Pretty Name instance Pretty Op instance Pretty QName instance Pretty QOp instance Pretty FieldUpdate instance Pretty Stmt instance Pretty GuardedAlt instance Pretty GuardedAlts instance Pretty Alt instance Pretty RPatOp instance Pretty RPat instance Pretty PatField instance Pretty PXAttr instance Pretty Pat instance Pretty Splice instance Pretty Bracket instance Pretty XName instance Pretty XAttr instance Pretty Exp instance Pretty Literal instance Pretty GuardedRhs instance Pretty Rhs instance Pretty FunDep instance Pretty Kind instance Pretty TyVarBind instance Pretty Type instance Pretty BangType instance Pretty ConDecl instance Pretty GadtDecl instance Pretty QualConDecl instance Pretty Tool instance Pretty OptionPragma instance Pretty RuleVar instance Pretty Activation instance Pretty Rule instance Pretty CallConv instance Pretty Safety instance Pretty InstDecl instance Pretty ClassDecl instance Pretty Match instance Pretty Assoc instance Pretty DataOrNew instance Pretty Decl instance Pretty ImportSpec instance Pretty ImportDecl instance Pretty ExportSpec instance Pretty ModuleName instance Pretty Module instance Monad (DocM s) instance Functor (DocM s) module Language.Haskell.Exts.Parser -- | Parse of a string, which should contain a complete Haskell 98 module. parseModule :: String -> ParseResult Module -- | Parse of a string, which should contain a complete Haskell 98 module. parseModuleWithMode :: ParseMode -> String -> ParseResult Module -- | Static parameters governing a parse. More to come later, e.g. literate -- mode, language extensions. data ParseMode ParseMode :: String -> ParseMode -- | original name of the file being parsed parseFilename :: ParseMode -> String -- | Default parameters for a parse, currently just a marker for an unknown -- filename. defaultParseMode :: ParseMode -- | The result of a parse. data ParseResult a -- | The parse succeeded, yielding a value. ParseOk :: a -> ParseResult a -- | The parse failed at the specified source location, with an error -- message. ParseFailed :: SrcLoc -> String -> ParseResult a module Language.Haskell.Exts parseFileContents :: String -> ParseResult Module parseFileContentsWithMode :: ParseMode -> String -> ParseResult Module parseFile :: FilePath -> IO (ParseResult Module)