[commit: ghc] master: Refactor the constraint solver (again!) (06aac68)
git at git.haskell.org
git at git.haskell.org
Wed Nov 6 09:42:51 UTC 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/06aac68dee100b21dc7d304fa90d9baa423507a0/ghc
>---------------------------------------------------------------
commit 06aac68dee100b21dc7d304fa90d9baa423507a0
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Nov 5 12:38:33 2013 +0000
Refactor the constraint solver (again!)
There are three core changes here:
a) In the constraint-solver pipeline.
Given a work-item 'wi', the old scheme was:
let relevant = getRelevantInerts wi
interact 'wi' with each constraint in 'relevant'
Bu now we have a single step
interact 'wi' with the inert-set
This turns out to avoid duplication, between getRelevantInerts
(which needs to know which are relevant) and the interact step.
Simpler, cleaner.
This in turn made it sensible to combine the 'spontaneous solve'
stage into the 'interact with inerts' stage.
b) Wanteds are no longer used to rewrite wanteds. See Trac #8450.
This in turn means that the inert set may have
- many CFunEqCans with the same LHS
- many CTyEqCans with the same LHS
Hence the EqualCtList in teh domain of inert_eqs and inert_funeqs
c) Some refactoring of the representation of the inert set,
Notably inert_dicts and inert_funeqs are indexed by Class and TyCon
respectively, so we can easily get all the constraints relevant to
that class or tycon
There are many knock on effects! This started as a small job but I
ended up doing qite a lot. Some error messages in the test suite
really did improve as a result of (b)
>---------------------------------------------------------------
06aac68dee100b21dc7d304fa90d9baa423507a0
compiler/typecheck/TcCanonical.lhs | 46 +-
compiler/typecheck/TcErrors.lhs | 145 +++--
compiler/typecheck/TcInteract.lhs | 1212 +++++++++++++++++++-----------------
compiler/typecheck/TcRnTypes.lhs | 86 ++-
compiler/typecheck/TcSMonad.lhs | 585 +++++++++--------
libraries/Cabal | 2 +-
6 files changed, 1081 insertions(+), 995 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 06aac68dee100b21dc7d304fa90d9baa423507a0
More information about the ghc-commits
mailing list