X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnMonad.lhs;h=944acb4b3ea0d8bc7514309c0bbb4c0d207df99f;hb=2dad6b8373e3079ff11c4d40e2512755b525172b;hp=fae50f335f5ce9239bc0a34240c6fae946bdd982;hpb=a61995821fca70c4d62769757d6808ebbc970e12;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnMonad.lhs b/ghc/compiler/rename/RnMonad.lhs index fae50f3..944acb4 100644 --- a/ghc/compiler/rename/RnMonad.lhs +++ b/ghc/compiler/rename/RnMonad.lhs @@ -20,7 +20,11 @@ module RnMonad( #include "HsVersions.h" +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 302 import PrelIOBase ( fixIO ) -- Should be in GlaExts +#else +import IOBase ( fixIO ) +#endif import IOExts ( IORef, newIORef, readIORef, writeIORef, unsafePerformIO ) import HsSyn @@ -193,12 +197,14 @@ type FixityEnv = NameEnv RenamedFixitySig type RnNameSupply = ( UniqSupply - , FiniteMap (OccName, OccName) Int + , FiniteMap String Int -- This is used as a name supply for dictionary functions - -- From the inst decl we derive a (class, tycon) pair; + -- From the inst decl we derive a string, usually by glomming together + -- the class and tycon name -- but it doesn't matter exactly how; -- this map then gives a unique int for each inst decl with that - -- (class, tycon) pair. (In Haskell 98 there can only be one, - -- but not so in more extended versions.) + -- string. (In Haskell 98 there can only be one, + -- but not so in more extended versions; also class CC type T + -- and class C type TT might both give the string CCT -- -- We could just use one Int for all the instance decls, but this -- way the uniques change less when you add an instance decl, @@ -611,7 +617,7 @@ setNameSupplyRn names' (RnDown {rn_ns = names_var}) l_down = writeIORef names_var names' -- See comments with RnNameSupply above. -newInstUniq :: (OccName, OccName) -> RnM d Int +newInstUniq :: String -> RnM d Int newInstUniq key (RnDown {rn_ns = names_var}) l_down = readIORef names_var >>= \ (us, mapInst, cache) -> let