ghc-7.8.4: The GHC API

Safe HaskellNone
LanguageHaskell98

HsUtils

Synopsis

Documentation

mkHsPar :: LHsExpr id -> LHsExpr id

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

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

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

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

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

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

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

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

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

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

mkHsWrapPat :: HsWrapper -> Pat id -> Type -> Pat id

mkHsWrapPatCo :: TcCoercion -> Pat id -> Type -> Pat id

mkLHsPar :: LHsExpr name -> LHsExpr name

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

nlHsVar :: id -> LHsExpr id

nlHsApp :: LHsExpr id -> LHsExpr id -> LHsExpr id

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

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

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

nlHsLam :: LMatch id (LHsExpr id) -> LHsExpr id

nlHsPar :: LHsExpr id -> LHsExpr id

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

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

nlList :: [LHsExpr id] -> LHsExpr id

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

mkNPat :: HsOverLit id -> Maybe (SyntaxExpr id) -> Pat id

mkNPlusKPat :: Located id -> HsOverLit id -> Pat id

nlVarPat :: id -> LPat id

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

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

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

nlNullaryConPat :: id -> LPat id

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

mkParPat :: LPat name -> LPat name

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

userHsTyVarBndrs :: SrcSpan -> [name] -> [Located (HsTyVarBndr name)]

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

nlHsTyVar :: name -> LHsType name

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

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

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

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

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

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

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

emptyTransStmt :: StmtLR idL idR (LHsExpr idR)

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

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

emptyRecStmt :: StmtLR idL idR bodyR

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

collectHsValBinders :: HsValBindsLR idL idR -> [idL]

collectHsBindListBinders :: [LHsBindLR idL idR] -> [idL]

collectHsBindsBinders :: LHsBindsLR idL idR -> [idL]

collectHsBindBinders :: HsBindLR idL idR -> [idL]

collectPatsBinders :: [LPat a] -> [a]

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

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

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

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

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

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

lStmtsImplicits :: [LStmtLR Name idR (Located (body idR))] -> NameSet