Moduleghc-9.10.3GHC2021
GHC.Rename.Utils
- 1 type
- 51 values
- Packageghc-9.10.3
- Exports52
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceUtils.hs
Ensure that a boxed or unboxed tuple has arity no larger than mAX_TUPLE_SIZE.
Ensure that a constraint tuple has arity no larger than mAX_CTUPLE_SIZE.
Whether to report deprecation warnings when registering a used GRE
There is no option to only emit declaration warnings since everywhere we emit the declaration warnings we also emit export warnings (See Note [Handling of deprecations] for details)
Checks to see if we need to warn for -Wunused-record-wildcards or -Wredundant-record-wildcards
Keeps the span given to the Name for the application head only
Throw an error message if a user attempts to quantify an inferred type
variable in a place where specificity cannot be observed. For example,
forall {a}. [a] -> [a] would be rejected to the inferred type variable
{a}, but forall a. [a] -> [a] would be accepted.
See Note [Unobservably inferred type variables].
Examines a non-outermost type for foralls or contexts, which are assumed
to be nested. For example, in the following declaration:
instance forall a. forall b. C (Either a b)
The outermost forall a is fine, but the nested forall b is not. We
invoke noNestedForallsContextsErr on the type forall b. C (Either a b)
to catch the nested forall and create a suitable error message.
noNestedForallsContextsErr returns Just err_msg if such a forall or
context is found, and returns Nothing otherwise.
This is currently used in the following places:
In GADT constructor types (in
rnConDecl). SeeNote [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)in GHC.Hs.Type.In instance declaration types (in
rnClsIntDeclandrnSrcDerivDeclin GHC.Rename.Module andrenameSigin GHC.Rename.Bind). SeeNote [No nested foralls or contexts in instance types]in GHC.Hs.Type.
A common way to invoke noNestedForallsContextsErr.