summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcGenGenerics.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-06-24 22:35:32 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-06-26 08:33:04 +0100
commitff8a67164b294b5eb6caee38ec59e7e400e025dc (patch)
tree66ff5cd8dd34c9c804fcf04dd0612063fde47f9d /compiler/typecheck/TcGenGenerics.hs
parent9195927d093504e233225dfb40f2f6b95a78925e (diff)
downloadhaskell-ff8a67164b294b5eb6caee38ec59e7e400e025dc.tar.gz
Use a Representaional coercion for data families
When we have data instance T (a,b) = MkT a b we make a represntation type data TPair a b = MkT a b plus an axiom to connect the two ax a b :: T (a,b) ~R TPair a b Previously this was a Nominal equality, and that worked ok but seems illogical since Nominal equalities are between types that the programmer thinks of as being equal. But TPair is not visible to the programmer; indeed we call it the "representation TyCon". So a Representational equality seems more suitable here.
Diffstat (limited to 'compiler/typecheck/TcGenGenerics.hs')
-rw-r--r--compiler/typecheck/TcGenGenerics.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/typecheck/TcGenGenerics.hs b/compiler/typecheck/TcGenGenerics.hs
index 649aa5fc99..63fee7fc28 100644
--- a/compiler/typecheck/TcGenGenerics.hs
+++ b/compiler/typecheck/TcGenGenerics.hs
@@ -506,7 +506,7 @@ tc_mkRepFamInsts gk tycon metaDts mod =
in newGlobalBinder mod (mkGen (nameOccName (tyConName tycon)))
(nameSrcSpan (tyConName tycon))
- ; let axiom = mkSingleCoAxiom rep_name tyvars fam_tc appT repTy
+ ; let axiom = mkSingleCoAxiom Nominal rep_name tyvars fam_tc appT repTy
; newFamInst SynFamilyInst axiom }
--------------------------------------------------------------------------------