ghc-7.8.20140130: The GHC API

Safe HaskellNone
LanguageHaskell98

HsUtils

Synopsis

Documentation

mkHsApp :: LHsExpr name -> LHsExpr name -> LHsExpr nameSource

mkSimpleHsAlt :: LPat id -> Located (body id) -> LMatch id (Located (body id))Source

mkSimpleMatch :: [LPat id] -> Located (body id) -> LMatch id (Located (body id))Source

unguardedGRHSs :: Located (body id) -> GRHSs id (Located (body id))Source

unguardedRHS :: Located (body id) -> [LGRHS id (Located (body id))]Source

mkMatchGroup :: [LMatch id (Located (body id))] -> MatchGroup id (Located (body id))Source

mkMatch :: [LPat id] -> LHsExpr id -> HsLocalBinds id -> LMatch id (LHsExpr id)Source

mkHsLam :: [LPat id] -> LHsExpr id -> LHsExpr idSource

mkHsIf :: LHsExpr id -> LHsExpr id -> LHsExpr id -> HsExpr idSource

mkHsOpApp :: LHsExpr id -> id -> LHsExpr id -> HsExpr idSource

nlHsTyApp :: name -> [Type] -> LHsExpr nameSource

nlHsApps :: id -> [LHsExpr id] -> LHsExpr idSource

nlHsVarApps :: id -> [id] -> LHsExpr idSource

nlHsOpApp :: LHsExpr id -> id -> LHsExpr id -> LHsExpr idSource

nlHsIf :: LHsExpr id -> LHsExpr id -> LHsExpr id -> LHsExpr idSource

nlHsCase :: LHsExpr id -> [LMatch id (LHsExpr id)] -> LHsExpr idSource

mkVarBind :: id -> LHsExpr id -> LHsBind idSource

nlVarPat :: id -> LPat idSource

nlConVarPat :: id -> [id] -> LPat idSource

nlConPat :: id -> [LPat id] -> LPat idSource

nlInfixConPat :: id -> LPat id -> LPat id -> LPat idSource

nlTuplePat :: [LPat id] -> Boxity -> LPat idSource

mkParPat :: LPat name -> LPat nameSource

mkHsAppTy :: LHsType name -> LHsType name -> LHsType nameSource

nlHsAppTy :: LHsType name -> LHsType name -> LHsType nameSource

nlHsTyVar :: name -> LHsType nameSource

nlHsFunTy :: LHsType name -> LHsType name -> LHsType nameSource

nlHsTyConApp :: name -> [LHsType name] -> LHsType nameSource

mkTransformStmt :: [ExprLStmt idL] -> LHsExpr idR -> StmtLR idL idR (LHsExpr idL)Source

mkTransformByStmt :: [ExprLStmt idL] -> LHsExpr idR -> LHsExpr idR -> StmtLR idL idR (LHsExpr idL)Source

mkBodyStmt :: Located (bodyR idR) -> StmtLR idL idR (Located (bodyR idR))Source

mkBindStmt :: LPat idL -> Located (bodyR idR) -> StmtLR idL idR (Located (bodyR idR))Source

mkLastStmt :: Located (bodyR idR) -> StmtLR idL idR (Located (bodyR idR))Source

mkGroupUsingStmt :: [ExprLStmt idL] -> LHsExpr idR -> StmtLR idL idR (LHsExpr idL)Source

mkGroupByUsingStmt :: [ExprLStmt idL] -> LHsExpr idR -> LHsExpr idR -> StmtLR idL idR (LHsExpr idL)Source

emptyRecStmt :: StmtLR idL idR bodyRSource

mkRecStmt :: [LStmtLR idL idR bodyR] -> StmtLR idL idR bodyRSource

collectLStmtsBinders :: [LStmtLR idL idR body] -> [idL]Source

collectStmtsBinders :: [StmtLR idL idR body] -> [idL]Source

collectLStmtBinders :: LStmtLR idL idR body -> [idL]Source

collectStmtBinders :: StmtLR idL idR body -> [idL]Source

hsLTyClDeclBinders :: Eq name => Located (TyClDecl name) -> [Located name]Source

Returns all the binding names of the decl. The first one is guaranteed to be the name of the decl. For record fields mentioned in multiple constructors, the SrcLoc will be from the first occurrence. We use the equality to filter out duplicate field names.

Each returned (Located name) is wrapped in a SrcSpan of the whole declaration, not just the name itself (which is how it appears in the syntax tree). This SrcSpan (for the entire declaration) is used as the SrcSpan for the Name that is finally produced, and hence for error messages. (See Trac #8607.)