[commit: ghc] master: Refactor coercion holes (a492af0)
git at git.haskell.org
git at git.haskell.org
Thu Dec 21 14:55:40 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a492af06d3264530d134584f22ffb726a16c78ec/ghc
>---------------------------------------------------------------
commit a492af06d3264530d134584f22ffb726a16c78ec
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.
>---------------------------------------------------------------
a492af06d3264530d134584f22ffb726a16c78ec
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 +++++----
25 files changed, 234 insertions(+), 208 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 a492af06d3264530d134584f22ffb726a16c78ec
More information about the ghc-commits
mailing list