diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-06-22 11:46:03 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-06-22 11:46:03 +0100 |
commit | a9d48fd94ae92b979610f5efe5d66506928118eb (patch) | |
tree | f456de82c3eaa4939e5be2c2fc63c809d3a31514 /compiler/iface | |
parent | 089cc2928c8c0e8107448e62b29b6392a1abe30f (diff) | |
download | haskell-a9d48fd94ae92b979610f5efe5d66506928118eb.tar.gz |
Remove "silent superclass parameters"
We introduced silent superclass parameters as a way to avoid
superclass loops, but we now solve that problem a different
way ("derived" superclass constraints carry no evidence). So
they aren't needed any more.
Apart from being a needless complication, they broke DoCon.
Admittedly in a very obscure way, but still the result is
hard to explain. To see the details see Trac #5051, with
test case typecheck/should_compile/T5051. (The test is
nice and small!)
Diffstat (limited to 'compiler/iface')
-rw-r--r-- | compiler/iface/BinIface.hs | 8 | ||||
-rw-r--r-- | compiler/iface/IfaceSyn.lhs | 4 | ||||
-rw-r--r-- | compiler/iface/MkIface.lhs | 2 | ||||
-rw-r--r-- | compiler/iface/TcIface.lhs | 5 |
4 files changed, 8 insertions, 11 deletions
diff --git a/compiler/iface/BinIface.hs b/compiler/iface/BinIface.hs index 0fab2d28c8..1e24f34dd3 100644 --- a/compiler/iface/BinIface.hs +++ b/compiler/iface/BinIface.hs @@ -1173,7 +1173,7 @@ instance Binary IfaceBinding where instance Binary IfaceIdDetails where put_ bh IfVanillaId = putByte bh 0 put_ bh (IfRecSelId a b) = do { putByte bh 1; put_ bh a; put_ bh b } - put_ bh (IfDFunId n) = do { putByte bh 2; put_ bh n } + put_ bh IfDFunId = putByte bh 2 get bh = do h <- getByte bh case h of @@ -1181,7 +1181,7 @@ instance Binary IfaceIdDetails where 1 -> do a <- get bh b <- get bh return (IfRecSelId a b) - _ -> do { n <- get bh; return (IfDFunId n) } + _ -> return IfDFunId instance Binary IfaceIdInfo where put_ bh NoInfo = putByte bh 0 @@ -1276,12 +1276,10 @@ instance Binary IfaceUnfolding where instance Binary (DFunArg IfaceExpr) where put_ bh (DFunPolyArg e) = putByte bh 0 >> put_ bh e put_ bh (DFunConstArg e) = putByte bh 1 >> put_ bh e - put_ bh (DFunLamArg i) = putByte bh 2 >> put_ bh i get bh = do { h <- getByte bh ; case h of 0 -> do { a <- get bh; return (DFunPolyArg a) } - 1 -> do { a <- get bh; return (DFunConstArg a) } - _ -> do { a <- get bh; return (DFunLamArg a) } } + _ -> do { a <- get bh; return (DFunConstArg a) } } instance Binary IfaceNote where put_ bh (IfaceSCC aa) = do diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index 21783813f8..41732a9215 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -177,7 +177,7 @@ type IfaceAnnTarget = AnnTarget OccName data IfaceIdDetails = IfVanillaId | IfRecSelId IfaceTyCon Bool - | IfDFunId Int -- Number of silent args + | IfDFunId data IfaceIdInfo = NoInfo -- When writing interface file without -O @@ -672,7 +672,7 @@ instance Outputable IfaceIdDetails where ppr IfVanillaId = empty ppr (IfRecSelId tc b) = ptext (sLit "RecSel") <+> ppr tc <+> if b then ptext (sLit "<naughty>") else empty - ppr (IfDFunId ns) = ptext (sLit "DFunId") <> brackets (int ns) + ppr IfDFunId = ptext (sLit "DFunId") instance Outputable IfaceIdInfo where ppr NoInfo = empty diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 2ec14e48cb..42a4278b4f 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -1498,7 +1498,7 @@ toIfaceLetBndr id = IfLetBndr (occNameFS (getOccName id)) -------------------------- toIfaceIdDetails :: IdDetails -> IfaceIdDetails toIfaceIdDetails VanillaId = IfVanillaId -toIfaceIdDetails (DFunId ns _) = IfDFunId ns +toIfaceIdDetails (DFunId {}) = IfDFunId toIfaceIdDetails (RecSelId { sel_naughty = n , sel_tycon = tc }) = IfRecSelId (toIfaceTyCon tc) n toIfaceIdDetails other = pprTrace "toIfaceIdDetails" (ppr other) diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index ab28615c80..2187f03c61 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -1026,8 +1026,8 @@ do_one (IfaceRec pairs) thing_inside \begin{code} tcIdDetails :: Type -> IfaceIdDetails -> IfL IdDetails tcIdDetails _ IfVanillaId = return VanillaId -tcIdDetails ty (IfDFunId ns) - = return (DFunId ns (isNewTyCon (classTyCon cls))) +tcIdDetails ty IfDFunId + = return (DFunId (isNewTyCon (classTyCon cls))) where (_, _, cls, _) = tcSplitDFunTy ty @@ -1099,7 +1099,6 @@ tcUnfolding name dfun_ty _ (IfDFunUnfold ops) doc = text "Class ops for dfun" <+> ppr name tc_arg (DFunPolyArg e) = do { e' <- tcIfaceExpr e; return (DFunPolyArg e') } tc_arg (DFunConstArg e) = do { e' <- tcIfaceExpr e; return (DFunConstArg e') } - tc_arg (DFunLamArg i) = return (DFunLamArg i) tcUnfolding name ty info (IfExtWrapper arity wkr) = tcIfaceWrapper name ty info arity (tcIfaceExtId wkr) |