summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-12-10 08:41:16 +0000
committersimonpj@microsoft.com <unknown>2010-12-10 08:41:16 +0000
commitb32e8c32b529411536612662d61f5445cee456db (patch)
treee9a076a5a41840123abcd60ab7c26ee6c346ac79 /compiler
parent29c2794f358b1175f5402d81bb84fd26a4d39019 (diff)
downloadhaskell-b32e8c32b529411536612662d61f5445cee456db.tar.gz
Comments only
Diffstat (limited to 'compiler')
-rw-r--r--compiler/specialise/Specialise.lhs16
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs
index f6f85a1140..0613aa3264 100644
--- a/compiler/specialise/Specialise.lhs
+++ b/compiler/specialise/Specialise.lhs
@@ -1174,16 +1174,22 @@ Note [Specialisation of dictionary functions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is a nasty example that bit us badly: see Trac #3591
+ class Eq a => C a
+ instance Eq [a] => C [a]
+
+---------------
+ dfun :: Eq [a] -> C [a]
dfun a d = MkD a d (meth d)
- d4 = <blah>
- d2 = dfun T d4
- d1 = $p1 d2
- d3 = dfun T d1
+
+ d4 :: Eq [T] = <blah>
+ d2 :: C [T] = dfun T d4
+ d1 :: Eq [T] = $p1 d2
+ d3 :: C [T] = dfun T d1
None of these definitions is recursive. What happened was that we
generated a specialisation:
- RULE forall d. dfun T d = dT
+ RULE forall d. dfun T d = dT :: C [T]
dT = (MkD a d (meth d)) [T/a, d1/d]
= MkD T d1 (meth d1)