diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-12-19 00:04:15 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-02-06 11:55:41 -0500 |
commit | ed2f0e5c38f1dfc9cf049ae63c56117cda99116e (patch) | |
tree | 09f89d7923ed378dbd7f664d8b3dd583ef5a0345 /compiler/utils/FastString.hs | |
parent | c4e6b35daef9336ea6b0922bab595cb02ac742b5 (diff) | |
download | haskell-ed2f0e5c38f1dfc9cf049ae63c56117cda99116e.tar.gz |
Reform the free variable finders for types
This patch delivers on (much of) #17509.
* Introduces the shallow vs deep free variable distinction
* Introduce TyCoRep.foldType,
foldType :: Monoid a => TyCoFolder env a
-> env -> Type -> a
and use it in the free variable finders.
* Substitution in TyCoSubst
* ASSERTs are on for checkValidSubst
* checkValidSubst uses shallowTyCoVarsOfTypes etc
Quite a few things still to do
* We could use foldType in lots of other places
* We could use mapType for substitution. (Check that we get
good code!)
* Some (but not yet all) clients of substitution can now
save time by using shallowTyCoVarsOfTypes
* All calls to tyCoVarsOfTypes should be inspected; most of
them should be shallow. Maybe.
* Currently shallowTyCoVarsOfTypes still returns
unification variables, but not CoVarHoles.
Reason: we need to return unification variables
in some of the calls in TcSimplify, eg when promoting.
* We should do the same thing for tyCoFVsOfTypes, which is
currently unchanged.
* tyCoFVsOfTypes returns CoVarHoles, because of the
use in TcSimplify.mkResidualConstraints. See
Note [Emitting the residual implication in simplifyInfer]
* #17509 talks about "relevant" variables too.
Diffstat (limited to 'compiler/utils/FastString.hs')
0 files changed, 0 insertions, 0 deletions