diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-07-28 10:55:25 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2020-08-14 13:36:07 +0100 |
commit | 780bbd78010173090d7ff49b410041a16bc65470 (patch) | |
tree | 924e50ae0c39af97bd454599928443e312fd0d66 /compiler/GHC/Tc/Module.hs | |
parent | 8a51b2ab7433c06bddca9699b0dfd8ab1d11879b (diff) | |
download | haskell-wip/T18323.tar.gz |
Add right-to-left rule for pattern bindingswip/T18323
Fix #18323 by adding a few lines of code to handle non-recursive
pattern bindings. see GHC.Tc.Gen.Bind
Note [Special case for non-recursive pattern bindings]
Alas, this confused the pattern-match overlap checker; see #18323.
Note that this patch only affects pattern bindings like that
for (x,y) in this program
combine :: (forall a . [a] -> a) -> [forall a. a -> a]
-> ((forall a . [a] -> a), [forall a. a -> a])
breaks = let (x,y) = combine head ids
in x y True
We need ImpredicativeTypes for those [forall a. a->a] types to be
valid. And with ImpredicativeTypes the old, unprincipled "allow
unification variables to unify with a polytype" story actually
works quite well. So this test compiles fine (if delicatedly) with
old GHCs; but not with QuickLook unless we add this patch
Diffstat (limited to 'compiler/GHC/Tc/Module.hs')
0 files changed, 0 insertions, 0 deletions