ghc-7.8.3: The GHC API

Safe HaskellNone
LanguageHaskell98

HsUtils

Synopsis

Documentation

mkHsApp :: LHsExpr name -> LHsExpr name -> LHsExpr name Source

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 :: Origin -> [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 id Source

mkHsIf :: LHsExpr id -> LHsExpr id -> LHsExpr id -> HsExpr id Source

mkHsOpApp :: LHsExpr id -> id -> LHsExpr id -> HsExpr id Source

mkLHsPar :: LHsExpr name -> LHsExpr name Source

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

nlHsVar :: id -> LHsExpr id Source

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

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

nlHsOpApp :: LHsExpr id -> id -> LHsExpr id -> LHsExpr id Source

nlHsIf :: LHsExpr id -> LHsExpr id -> LHsExpr id -> LHsExpr id Source

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

mkVarBind :: id -> LHsExpr id -> LHsBind id Source

nlVarPat :: id -> LPat id Source

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

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

nlInfixConPat :: id -> LPat id -> LPat id -> LPat id Source

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

mkParPat :: LPat name -> LPat name Source

mkHsAppTy :: LHsType name -> LHsType name -> LHsType name Source

nlHsAppTy :: LHsType name -> LHsType name -> LHsType name Source

nlHsTyVar :: name -> LHsType name Source

nlHsFunTy :: LHsType name -> LHsType name -> LHsType name Source

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

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

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

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