diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-07-09 22:22:34 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-18 07:26:43 -0400 |
commit | bcb177dd00c91d825e00ed228bce6cfeb7684bf7 (patch) | |
tree | 78094377d9f81531b39fbdaaa82bff600ac3b958 /compiler/GHC/Tc/Instance/Class.hs | |
parent | e6cf27dfded59fe42bd6be323573c0d576e6204a (diff) | |
download | haskell-bcb177dd00c91d825e00ed228bce6cfeb7684bf7.tar.gz |
Allow multiple case branches to have a higher rank type
As #18412 points out, it should be OK for multiple case alternatives
to have a higher rank type, provided they are all the same.
This patch implements that change. It sweeps away
GHC.Tc.Gen.Match.tauifyMultipleBranches, and friends, replacing it
with an enhanced version of fillInferResult.
The basic change to fillInferResult is to permit the case in which
another case alternative has already filled in the result; and in
that case simply unify. It's very simple actually.
See the new Note [fillInferResult] in TcMType
Other refactoring:
- Move all the InferResult code to one place, in GHC.Tc.Utils.TcMType
(previously some of it was in Unify)
- Move tcInstType and friends from TcMType to Instantiate, where it
more properly belongs. (TCMType was getting very long.)
Diffstat (limited to 'compiler/GHC/Tc/Instance/Class.hs')
-rw-r--r-- | compiler/GHC/Tc/Instance/Class.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Instance/Class.hs b/compiler/GHC/Tc/Instance/Class.hs index 1df66632a2..5446a756a3 100644 --- a/compiler/GHC/Tc/Instance/Class.hs +++ b/compiler/GHC/Tc/Instance/Class.hs @@ -16,6 +16,7 @@ import GHC.Prelude import GHC.Tc.Utils.Env import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcType +import GHC.Tc.Utils.Instantiate( tcInstType ) import GHC.Tc.Instance.Typeable import GHC.Tc.Utils.TcMType import GHC.Tc.Types.Evidence |