[commit: ghc] wip/T9858-typeable-ben: TyCon: Data family TyCons are injective under Nominal equality (e50c010)
git at git.haskell.org
git at git.haskell.org
Wed Oct 28 10:46:31 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T9858-typeable-ben
Link : http://ghc.haskell.org/trac/ghc/changeset/e50c0106fbd2d4ffcc659d77265245c029951279/ghc
>---------------------------------------------------------------
commit e50c0106fbd2d4ffcc659d77265245c029951279
Author: Ben Gamari <ben at smart-cactus.org>
Date: Wed Oct 28 11:40:39 2015 +0100
TyCon: Data family TyCons are injective under Nominal equality
>---------------------------------------------------------------
e50c0106fbd2d4ffcc659d77265245c029951279
compiler/types/TyCon.hs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs
index 6745070..000dc3d 100644
--- a/compiler/types/TyCon.hs
+++ b/compiler/types/TyCon.hs
@@ -1367,7 +1367,8 @@ isInjectiveTyCon (AlgTyCon {}) Nominal = True
isInjectiveTyCon (AlgTyCon {algTcRhs = rhs}) Representational
= isGenInjAlgRhs rhs
isInjectiveTyCon (SynonymTyCon {}) _ = False
-isInjectiveTyCon (FamilyTyCon {}) _ = False
+isInjectiveTyCon (FamilyTyCon {famTcFlav = flav}) Nominal = isDataFamFlav flav
+isInjectiveTyCon (FamilyTyCon {}) Representational = False
isInjectiveTyCon (PrimTyCon {}) _ = True
isInjectiveTyCon (PromotedDataCon {}) _ = True
isInjectiveTyCon (PromotedTyCon {ty_con = tc}) r
More information about the ghc-commits
mailing list