summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/HsUtils.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/hsSyn/HsUtils.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/hsSyn/HsUtils.hs')
-rw-r--r--compiler/hsSyn/HsUtils.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs
index fd3d5efa6a..2242d10f76 100644
--- a/compiler/hsSyn/HsUtils.hs
+++ b/compiler/hsSyn/HsUtils.hs
@@ -23,7 +23,7 @@ module HsUtils(
mkSimpleMatch, unguardedGRHSs, unguardedRHS,
mkMatchGroup, mkMatchGroupName, mkMatch, mkHsLam, mkHsIf,
mkHsWrap, mkLHsWrap, mkHsWrapCo, mkHsWrapCoR, mkLHsWrapCo,
- coToHsWrapper, mkHsDictLet, mkHsLams,
+ coToHsWrapper, coToHsWrapperR, mkHsDictLet, mkHsLams,
mkHsOpApp, mkHsDo, mkHsComp, mkHsWrapPat, mkHsWrapPatCo,
mkLHsPar, mkHsCmdCast,
@@ -477,11 +477,11 @@ mkHsWrap :: HsWrapper -> HsExpr id -> HsExpr id
mkHsWrap co_fn e | isIdHsWrapper co_fn = e
| otherwise = HsWrap co_fn e
-mkHsWrapCo :: TcCoercion -- A Nominal coercion a ~N b
+mkHsWrapCo :: TcCoercionN -- A Nominal coercion a ~N b
-> HsExpr id -> HsExpr id
mkHsWrapCo co e = mkHsWrap (coToHsWrapper co) e
-mkHsWrapCoR :: TcCoercion -- A Representational coercion a ~R b
+mkHsWrapCoR :: TcCoercionR -- A Representational coercion a ~R b
-> HsExpr id -> HsExpr id
mkHsWrapCoR co e = mkHsWrap (coToHsWrapperR co) e