[commit: ghc] wip/rwbarton-dep-finsts: WIP: FamInst: Don't need to check imports against their dep_finsts (12d1c70)
git at git.haskell.org
git at git.haskell.org
Mon Jan 9 20:46:42 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rwbarton-dep-finsts
Link : http://ghc.haskell.org/trac/ghc/changeset/12d1c70c8c40dd0f40a3cbe036073a3fc15348fc/ghc
>---------------------------------------------------------------
commit 12d1c70c8c40dd0f40a3cbe036073a3fc15348fc
Author: Reid Barton <rwbarton at gmail.com>
Date: Mon Jan 9 13:43:36 2017 -0500
WIP: FamInst: Don't need to check imports against their dep_finsts
Test Plan: harbormaster
Reviewers: austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2947
>---------------------------------------------------------------
12d1c70c8c40dd0f40a3cbe036073a3fc15348fc
compiler/typecheck/FamInst.hs | 5 ++++-
testsuite/tests/ghci/scripts/T4175.stdout | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index 0c1bdef..0dd385d 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -120,6 +120,9 @@ modules where both modules occur in the `HscTypes.dep_finsts' set (of the
already been checked. Everything else, we check now. (So that we can be
certain that the modules in our `HscTypes.dep_finsts' are consistent.)
+XXX Presumably, each of our imports has itself already been checked against
+its dep_finsts, as well.
+
There is some fancy footwork regarding hs-boot module loops, see
Note [Don't check hs-boot type family instances too early]
-}
@@ -211,7 +214,7 @@ checkFamInstConsistency famInstMods directlyImpMods
. md_fam_insts . hm_details
; hpt_fam_insts = mkModuleEnv [ (hmiModule hmi, hmiFamInstEnv hmi)
| hmi <- eltsHpt hpt]
- ; groups = map (dep_finsts . mi_deps . modIface)
+ ; groups = map (\mod -> mod : (dep_finsts . mi_deps . modIface $ mod))
directlyImpMods
; okPairs = listToSet $ concatMap allPairs groups
-- instances of okPairs are consistent
diff --git a/testsuite/tests/ghci/scripts/T4175.stdout b/testsuite/tests/ghci/scripts/T4175.stdout
index d96a2ef..994886c 100644
--- a/testsuite/tests/ghci/scripts/T4175.stdout
+++ b/testsuite/tests/ghci/scripts/T4175.stdout
@@ -28,9 +28,9 @@ instance Show () -- Defined in ‘GHC.Show’
type instance D () a = Bool -- Defined at T4175.hs:22:10
data instance B () = MkB -- Defined at T4175.hs:13:15
data Maybe a = Nothing | Just a -- Defined in ‘GHC.Base’
-instance Foldable Maybe -- Defined in ‘Data.Foldable’
instance Traversable Maybe -- Defined in ‘Data.Traversable’
instance Monoid a => Monoid (Maybe a) -- Defined in ‘GHC.Base’
+instance Foldable Maybe -- Defined in ‘Data.Foldable’
instance Read a => Read (Maybe a) -- Defined in ‘GHC.Read’
instance Applicative Maybe -- Defined in ‘GHC.Base’
instance Functor Maybe -- Defined in ‘GHC.Base’
More information about the ghc-commits
mailing list