diff options
author | sheaf <sam.derbyshire@gmail.com> | 2021-10-26 11:42:19 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-26 12:37:02 -0400 |
commit | 9cc6c1932dbbd3d27405a8ebe5586a0ef09dd7fd (patch) | |
tree | eb49861c236210db092e9c14ffc11e1441e44d96 /docs | |
parent | 0255ef38b1bb0d4f3608bf92ebc8a93955ccb30a (diff) | |
download | haskell-9cc6c1932dbbd3d27405a8ebe5586a0ef09dd7fd.tar.gz |
Don't default type variables in type families
This patch removes the following defaulting of type variables
in type and data families:
- type variables of kind RuntimeRep defaulting to LiftedRep
- type variables of kind Levity defaulting to Lifted
- type variables of kind Multiplicity defaulting to Many
It does this by passing "defaulting options" to the `defaultTyVars`
function; when calling from `tcTyFamInstEqnGuts` or
`tcDataFamInstHeader` we pass options that avoid defaulting.
This avoids wildcards being defaulted, which caused type families
to unexpectedly fail to reduce.
Note that kind defaulting, applicable only with -XNoPolyKinds,
is not changed by this patch.
Fixes #17536
-------------------------
Metric Increase:
T12227
-------------------------
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/exts/representation_polymorphism.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/users_guide/exts/representation_polymorphism.rst b/docs/users_guide/exts/representation_polymorphism.rst index 3e6d250d27..28b3cc78bf 100644 --- a/docs/users_guide/exts/representation_polymorphism.rst +++ b/docs/users_guide/exts/representation_polymorphism.rst @@ -114,14 +114,14 @@ Printing representation-polymorphic types ----------------------------------------- .. ghc-flag:: -fprint-explicit-runtime-reps - :shortdesc: Print ``RuntimeRep`` variables in types which are + :shortdesc: Print ``RuntimeRep`` and ``Levity`` variables in types which are runtime-representation polymorphic. :type: dynamic :reverse: -fno-print-explicit-runtime-reps :category: verbosity - Print ``RuntimeRep`` parameters as they appear; otherwise, they are - defaulted to ``LiftedRep``. + Print ``RuntimeRep`` and ``Levity`` parameters as they appear; + otherwise, they are defaulted to ``LiftedRep`` and ``Lifted``, respectively. Most GHC users will not need to worry about representation polymorphism or unboxed types. For these users, seeing the representation polymorphism |