[commit: ghc] ghc-8.4: Refactor coercion holes (b586f77)
git at git.haskell.org
git at git.haskell.org
Sun Jan 14 22:07:50 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.4
Link : http://ghc.haskell.org/trac/ghc/changeset/b586f77b3384ce4d38e83205e7c0355c9b626b0a/ghc
>---------------------------------------------------------------
commit b586f77b3384ce4d38e83205e7c0355c9b626b0a
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Dec 21 13:31:13 2017 +0000
Refactor coercion holes
In fixing Trac #14584 I found that it would be /much/ more
convenient if a "hole" in a coercion (much like a unification
variable in a type) acutally had a CoVar associated with it
rather than just a Unique. Then I can ask what the free variables
of a coercion is, and get a set of CoVars including those
as-yet-un-filled in holes.
Once that is done, it makes no sense to stuff coercion holes
inside UnivCo. They were there before so we could know the
kind and role of a "hole" coercion, but once there is a CoVar
we can get that info from the CoVar. So I removed HoleProv
from UnivCoProvenance and added HoleCo to Coercion.
In summary:
* Add HoleCo to Coercion and remove HoleProv from UnivCoProvanance
* Similarly in IfaceCoercion
* Make CoercionHole have a CoVar in it, not a Unique
* Make tyCoVarsOfCo return the free coercion-hole variables
as well as the ordinary free CoVars. Similarly, remember
to zonk the CoVar in a CoercionHole
We could go further, and remove CoercionHole as a distinct type
altogther, just collapsing it into HoleCo. But I have not done
that yet.
(cherry picked from commit a492af06d3264530d134584f22ffb726a16c78ec)
>---------------------------------------------------------------
b586f77b3384ce4d38e83205e7c0355c9b626b0a
compiler/backpack/RnModIface.hs | 1 +
compiler/coreSyn/CoreFVs.hs | 2 +-
compiler/coreSyn/CoreLint.hs | 7 ++-
compiler/iface/IfaceSyn.hs | 5 +-
compiler/iface/IfaceType.hs | 56 ++++++++++-----------
compiler/iface/TcIface.hs | 5 +-
compiler/iface/ToIface.hs | 5 +-
compiler/typecheck/TcCanonical.hs | 2 +-
compiler/typecheck/TcEnv.hs | 16 ++++--
compiler/typecheck/TcErrors.hs | 6 +--
compiler/typecheck/TcHsSyn.hs | 30 +++++-------
compiler/typecheck/TcInteract.hs | 6 +--
compiler/typecheck/TcMType.hs | 75 +++++++++++++++-------------
compiler/typecheck/TcPluginM.hs | 4 +-
compiler/typecheck/TcRnTypes.hs | 25 ++++++----
compiler/typecheck/TcSMonad.hs | 4 +-
compiler/typecheck/TcTyDecls.hs | 2 +-
compiler/typecheck/TcType.hs | 14 +++---
compiler/typecheck/TcUnify.hs | 19 +++++---
compiler/typecheck/TcValidity.hs | 4 +-
compiler/types/Coercion.hs | 42 +++++++---------
compiler/types/FamInstEnv.hs | 2 +-
compiler/types/OptCoercion.hs | 7 +--
compiler/types/TyCoRep.hs | 84 +++++++++++++++++++-------------
compiler/types/Type.hs | 19 ++++----
testsuite/tests/polykinds/T11821a.stderr | 2 +-
testsuite/tests/polykinds/T14563.stderr | 4 +-
27 files changed, 237 insertions(+), 211 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b586f77b3384ce4d38e83205e7c0355c9b626b0a
More information about the ghc-commits
mailing list