ghc-7.7.20130829: The GHC API

Safe HaskellNone

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, along with their SrcLocs. 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 occurence. We use the equality to filter out duplicate field names

hsTyClDeclBinders :: Eq name => TyClDecl name -> [Located name]Source