diff options
| author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-03-17 17:46:05 +0000 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-12 11:20:58 -0400 |
| commit | cd4f92b5f4251f1a37d1e08ee97d99f2ccb41f26 (patch) | |
| tree | c1322cbb929c589a9dfe7e9cb983a8c344f96d95 /compiler/GHC/Tc/Module.hs | |
| parent | 0889f5eecfea8af6a9d74d48d9d86ff3aea331d6 (diff) | |
| download | haskell-cd4f92b5f4251f1a37d1e08ee97d99f2ccb41f26.tar.gz | |
Significant refactor of Lint
This refactoring of Lint was triggered by #17923, which is
fixed by this patch.
The main change is this. Instead of
lintType :: Type -> LintM LintedKind
we now have
lintType :: Type -> LintM LintedType
Previously, all of typeKind was effectively duplicate in lintType.
Moreover, since we have an ambient substitution, we still had to
apply the substition here and there, sometimes more than once. It
was all very tricky, in the end, and made my head hurt.
Now, lintType returns a fully linted type, with all substitutions
performed on it. This is much simpler.
The same thing is needed for Coercions. Instead of
lintCoercion :: OutCoercion
-> LintM (LintedKind, LintedKind,
LintedType, LintedType, Role)
we now have
lintCoercion :: Coercion -> LintM LintedCoercion
Much simpler! The code is shorter and less bug-prone.
There are a lot of knock on effects. But life is now better.
Metric Decrease:
T1969
Diffstat (limited to 'compiler/GHC/Tc/Module.hs')
0 files changed, 0 insertions, 0 deletions
