Use TauTv for pattern signature variables (#15050)
ClosedPublic

Authored by nomeata on Jul 17 2018, 10:55 AM.

Details

Summary

No notes updated yet.

Originally, SigTv was only used in pattern signatures (and a note
still claims that). But then it seems that the same behaviour is also
needed for kind variables. So this patch tries to not touch the
effect on kind variables, but it would be odd to continue to call
them PatTv.

Test Trac #15050 and Trac #7786 pass now.

Other test outputs now no longer trip over type variables in pattern signatures
being bound to full types, and thus give different error messages, but nothing
worrying, as far as I can tell.

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nomeata created this revision.Jul 17 2018, 10:55 AM
nomeata updated this revision to Diff 17368.Jul 17 2018, 12:03 PM

Update more test output

LGTM. I would "accept", but the proposal hasn't been accepted yet.

BTW, we really should rename SigTv. The name comes from Pattern Signature, I believe (which with this patch no longer applies), and it is very easy to confuse this with SigmaTv, i.e. a poly type meta variable. But in a separate refactoring commit, of course.

BTW, we really should rename SigTv. The name comes from Pattern Signature, I believe (which with this patch no longer applies), and it is very easy to confuse this with SigmaTv, i.e. a poly type meta variable. But in a separate refactoring commit, of course.

SigmaTv has not been seen around here for a few years, though...

simonpj added inline comments.Jul 18 2018, 5:14 AM
compiler/typecheck/TcHsType.hs
2424

But before committing you will surely add a Note to explain this, point to the proposal, Trac ticket etc, won't you?

2425–2426

This Note may need updating

Yes, as I wrote in the description of the PR: This is a pre-note preview :-)

nomeata edited the summary of this revision. (Show Details)Aug 4 2018, 11:45 AM
nomeata updated this revision to Diff 17573.Aug 4 2018, 11:45 AM
nomeata edited the summary of this revision. (Show Details)
  • Merge branch 'master' of git://git.haskell.org/ghc into wip/T15050
  • Turn the comment next to SigTv into a proper Note
nomeata updated this revision to Diff 17574.Aug 4 2018, 11:49 AM
  • Update Note [Pattern signature binders]
nomeata updated this revision to Diff 17575.Aug 4 2018, 11:55 AM
  • Merge remote-tracking branch 'origin/wip/T15050' into wip/T15050 Not sure why there are two branches...

The proposal got accepted. I rebased, updated this, added a bit of note editing, and consider this ready for merging.

goldfire added inline comments.Aug 5 2018, 9:44 AM
compiler/typecheck/TcHsType.hs
2513–2514

Should the name of the mata-tyvar no longer involve sig? Perhaps beta.

This note should also demonstrate (with reference to the accepted proposal) that the variable can unify with a type.

compiler/typecheck/TcMType.hs
638

Very helpful. Thanks!

nomeata marked 2 inline comments as done.Aug 5 2018, 7:45 PM
nomeata added inline comments.
compiler/typecheck/TcHsType.hs
2513–2514

Well spotted, I revised the Note.

nomeata updated this revision to Diff 17588.Aug 5 2018, 7:45 PM
nomeata marked an inline comment as done.
  • Extend Note [Pattern signature binders]
  • Actually update the user guide according to the proposal
goldfire accepted this revision.Aug 5 2018, 7:51 PM

Thanks!

This revision is now accepted and ready to land.Aug 5 2018, 7:51 PM

Ok, pushed. You may mention this in the camera ready version of the paper that I guess you might be working on right now :-)

This revision was automatically updated to reflect the committed changes.