RnTypes

ghc-8.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

RnTypes

Synopsis

- rnHsType :: HsDocContext -> HsType GhcPs -> RnM (HsType GhcRn, FreeVars)
- rnLHsType :: HsDocContext -> LHsType GhcPs -> RnM (LHsType GhcRn, FreeVars)
- rnLHsTypes :: HsDocContext -> [LHsType GhcPs] -> RnM ([LHsType GhcRn], FreeVars)
- rnContext :: HsDocContext -> LHsContext GhcPs -> RnM (LHsContext GhcRn, FreeVars)
- rnHsKind :: HsDocContext -> HsKind GhcPs -> RnM (HsKind GhcRn, FreeVars)
- rnLHsKind :: HsDocContext -> LHsKind GhcPs -> RnM (LHsKind GhcRn, FreeVars)
- rnLHsTypeArgs :: HsDocContext -> [LHsTypeArg GhcPs] -> RnM ([LHsTypeArg GhcRn], FreeVars)
- rnHsSigType :: HsDocContext -> TypeOrKind -> LHsSigType GhcPs -> RnM (LHsSigType GhcRn, FreeVars)
- rnHsWcType :: HsDocContext -> LHsWcType GhcPs -> RnM (LHsWcType GhcRn, FreeVars)
- data HsSigWcTypeScoping
  - = AlwaysBind
  - | BindUnlessForall
  - | NeverBind
- rnHsSigWcType :: HsSigWcTypeScoping -> HsDocContext -> LHsSigWcType GhcPs -> RnM (LHsSigWcType GhcRn, FreeVars)
- rnHsSigWcTypeScoped :: HsSigWcTypeScoping -> HsDocContext -> LHsSigWcType GhcPs -> (LHsSigWcType GhcRn -> RnM (a, FreeVars)) -> RnM (a, FreeVars)
- newTyVarNameRn :: Maybe a -> Located RdrName -> RnM Name
- rnConDeclFields :: HsDocContext -> [FieldLabel] -> [LConDeclField GhcPs] -> RnM ([LConDeclField GhcRn], FreeVars)
- rnLTyVar :: Located RdrName -> RnM (Located Name)
- mkOpAppRn :: LHsExpr GhcRn -> LHsExpr GhcRn -> Fixity -> LHsExpr GhcRn -> RnM (HsExpr GhcRn)
- mkNegAppRn :: LHsExpr (GhcPass id) -> SyntaxExpr (GhcPass id) -> RnM (HsExpr (GhcPass id))
- mkOpFormRn :: LHsCmdTop GhcRn -> LHsExpr GhcRn -> Fixity -> LHsCmdTop GhcRn -> RnM (HsCmd GhcRn)
- mkConOpPatRn :: Located Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn)
- checkPrecMatch :: Name -> MatchGroup GhcRn body -> RnM ()
- checkSectionPrec :: FixityDirection -> HsExpr GhcPs -> LHsExpr GhcRn -> LHsExpr GhcRn -> RnM ()
- bindLHsTyVarBndr :: HsDocContext -> Maybe a -> LHsTyVarBndr GhcPs -> (LHsTyVarBndr GhcRn -> RnM (b, FreeVars)) -> RnM (b, FreeVars)
- bindLHsTyVarBndrs :: HsDocContext -> Maybe SDoc -> Maybe a -> [LHsTyVarBndr GhcPs] -> ([LHsTyVarBndr GhcRn] -> RnM (b, FreeVars)) -> RnM (b, FreeVars)
- rnImplicitBndrs :: Bool -> FreeKiTyVarsWithDups -> ([Name] -> RnM (a, FreeVars)) -> RnM (a, FreeVars)
- bindSigTyVarsFV :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars)
- bindHsQTyVars :: forall a b. HsDocContext -> Maybe SDoc -> Maybe a -> [Located RdrName] -> LHsQTyVars GhcPs -> (LHsQTyVars GhcRn -> Bool -> RnM (b, FreeVars)) -> RnM (b, FreeVars)
- bindLRdrNames :: [Located RdrName] -> ([Name] -> RnM (a, FreeVars)) -> RnM (a, FreeVars)
- extractHsTyRdrTyVars :: LHsType GhcPs -> FreeKiTyVarsNoDups
- extractHsTyRdrTyVarsKindVars :: LHsType GhcPs -> FreeKiTyVarsNoDups
- extractHsTysRdrTyVarsDups :: [LHsType GhcPs] -> FreeKiTyVarsWithDups
- extractRdrKindSigVars :: LFamilyResultSig GhcPs -> [Located RdrName]
- extractDataDefnKindVars :: HsDataDefn GhcPs -> FreeKiTyVarsNoDups
- extractHsTvBndrs :: [LHsTyVarBndr GhcPs] -> FreeKiTyVarsWithDups -> FreeKiTyVarsWithDups
- extractHsTyArgRdrKiTyVarsDup :: [LHsTypeArg GhcPs] -> FreeKiTyVarsWithDups
- nubL :: Eq a => [Located a] -> [Located a]
- elemRdr :: Located RdrName -> [Located RdrName] -> Bool

# Documentation

rnHsType :: HsDocContext -> HsType GhcPs -> RnM (HsType GhcRn, FreeVars) Source #

rnLHsType :: HsDocContext -> LHsType GhcPs -> RnM (LHsType GhcRn, FreeVars) Source #

rnLHsTypes :: HsDocContext -> [LHsType GhcPs] -> RnM ([LHsType GhcRn], FreeVars) Source #

rnContext :: HsDocContext -> LHsContext GhcPs -> RnM (LHsContext GhcRn, FreeVars) Source #

rnHsKind :: HsDocContext -> HsKind GhcPs -> RnM (HsKind GhcRn, FreeVars) Source #

rnLHsKind :: HsDocContext -> LHsKind GhcPs -> RnM (LHsKind GhcRn, FreeVars) Source #

rnLHsTypeArgs :: HsDocContext -> [LHsTypeArg GhcPs] -> RnM ([LHsTypeArg GhcRn], FreeVars) Source #

rnHsSigType :: HsDocContext -> TypeOrKind -> LHsSigType GhcPs -> RnM (LHsSigType GhcRn, FreeVars) Source #

rnHsWcType :: HsDocContext -> LHsWcType GhcPs -> RnM (LHsWcType GhcRn, FreeVars) Source #

data HsSigWcTypeScoping Source #

Constructors

AlwaysBind | Always bind any free tyvars of the given type, regardless of whether we have a forall at the top
BindUnlessForall | Unless there's forall at the top, do the same thing as `AlwaysBind`
NeverBind | Never bind any free tyvars

rnHsSigWcType :: HsSigWcTypeScoping -> HsDocContext -> LHsSigWcType GhcPs -> RnM (LHsSigWcType GhcRn, FreeVars) Source #

rnHsSigWcTypeScoped :: HsSigWcTypeScoping -> HsDocContext -> LHsSigWcType GhcPs -> (LHsSigWcType GhcRn -> RnM (a, FreeVars)) -> RnM (a, FreeVars) Source #

newTyVarNameRn :: Maybe a -> Located RdrName -> RnM Name Source #

rnConDeclFields :: HsDocContext -> [FieldLabel] -> [LConDeclField GhcPs] -> RnM ([LConDeclField GhcRn], FreeVars) Source #

rnLTyVar :: Located RdrName -> RnM (Located Name) Source #

mkOpAppRn :: LHsExpr GhcRn -> LHsExpr GhcRn -> Fixity -> LHsExpr GhcRn -> RnM (HsExpr GhcRn) Source #

mkNegAppRn :: LHsExpr (GhcPass id) -> SyntaxExpr (GhcPass id) -> RnM (HsExpr (GhcPass id)) Source #

mkOpFormRn :: LHsCmdTop GhcRn -> LHsExpr GhcRn -> Fixity -> LHsCmdTop GhcRn -> RnM (HsCmd GhcRn) Source #

mkConOpPatRn :: Located Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) Source #

checkPrecMatch :: Name -> MatchGroup GhcRn body -> RnM () Source #

checkSectionPrec :: FixityDirection -> HsExpr GhcPs -> LHsExpr GhcRn -> LHsExpr GhcRn -> RnM () Source #

bindLHsTyVarBndr :: HsDocContext -> Maybe a -> LHsTyVarBndr GhcPs -> (LHsTyVarBndr GhcRn -> RnM (b, FreeVars)) -> RnM (b, FreeVars) Source #

bindLHsTyVarBndrs :: HsDocContext -> Maybe SDoc -> Maybe a -> [LHsTyVarBndr GhcPs] -> ([LHsTyVarBndr GhcRn] -> RnM (b, FreeVars)) -> RnM (b, FreeVars) Source #

rnImplicitBndrs :: Bool -> FreeKiTyVarsWithDups -> ([Name] -> RnM (a, FreeVars)) -> RnM (a, FreeVars) Source #

bindSigTyVarsFV :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars) Source #

bindHsQTyVars :: forall a b. HsDocContext -> Maybe SDoc -> Maybe a -> [Located RdrName] -> LHsQTyVars GhcPs -> (LHsQTyVars GhcRn -> Bool -> RnM (b, FreeVars)) -> RnM (b, FreeVars) Source #

bindLRdrNames :: [Located RdrName] -> ([Name] -> RnM (a, FreeVars)) -> RnM (a, FreeVars) Source #

Simply bring a bunch of RdrNames into scope. No checking for validity, at all. The binding location is taken from the location on each name.

extractHsTyRdrTyVars :: LHsType GhcPs -> FreeKiTyVarsNoDups Source #

`extractHsTyRdrTyVars` finds the type/kind variables of a HsType/HsKind. It's used when making the `forall`s explicit. When the same name occurs multiple times in the types, only the first occurrence is returned. See Note [Kind and type-variable binders]

extractHsTyRdrTyVarsKindVars :: LHsType GhcPs -> FreeKiTyVarsNoDups Source #

Extracts the free type/kind variables from the kind signature of a HsType. This is used to implicitly quantify over `k` in `type T = Nothing :: Maybe k`. When the same name occurs multiple times in the type, only the first occurrence is returned, and the left-to-right order of variables is preserved. See Note [Kind and type-variable binders] and Note [Ordering of implicit variables] and Note [Implicit quantification in type synonyms].

extractHsTysRdrTyVarsDups :: [LHsType GhcPs] -> FreeKiTyVarsWithDups Source #

Extracts free type and kind variables from types in a list. When the same name occurs multiple times in the types, all occurrences are returned.

extractRdrKindSigVars :: LFamilyResultSig GhcPs -> [Located RdrName] Source #

extractDataDefnKindVars :: HsDataDefn GhcPs -> FreeKiTyVarsNoDups Source #

extractHsTvBndrs :: [LHsTyVarBndr GhcPs] -> FreeKiTyVarsWithDups -> FreeKiTyVarsWithDups Source #

extractHsTyArgRdrKiTyVarsDup :: [LHsTypeArg GhcPs] -> FreeKiTyVarsWithDups Source #

nubL :: Eq a => [Located a] -> [Located a] Source #

elemRdr :: Located RdrName -> [Located RdrName] -> Bool Source #