ghc-7.10.3: The GHC API

Safe HaskellNone
LanguageHaskell2010

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 :: SrcSpan -> Located (body id) -> [LGRHS id (Located (body id))] Source

mkMatch :: [LPat id] -> LHsExpr id -> HsLocalBinds id -> LMatch 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

nlHsTyApps :: name -> [Type] -> [LHsExpr name] -> 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

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

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

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

mkRecStmt :: [LStmtLR idL RdrName bodyR] -> StmtLR idL RdrName 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) has a SrcSpan for the whole declaration. See Note [SrcSpan for binders]