summaryrefslogtreecommitdiff
path: root/libraries/base/Data
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/Data')
-rw-r--r--libraries/base/Data/IORef.hs7
-rw-r--r--libraries/base/Data/Typeable.hs8
-rw-r--r--libraries/base/Data/Typeable.hs-boot3
3 files changed, 4 insertions, 14 deletions
diff --git a/libraries/base/Data/IORef.hs b/libraries/base/Data/IORef.hs
index 1b4b110293..70ea4b1550 100644
--- a/libraries/base/Data/IORef.hs
+++ b/libraries/base/Data/IORef.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -XNoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.IORef
@@ -27,14 +28,12 @@ module Data.IORef
#endif
) where
-import Prelude -- Explicit dependency helps 'make depend' do the right thing
-
#ifdef __HUGS__
import Hugs.IORef
#endif
#ifdef __GLASGOW_HASKELL__
-import GHC.Base ( mkWeak#, atomicModifyMutVar# )
+import GHC.Base
import GHC.STRef
import GHC.IOBase
#if !defined(__PARALLEL_HASKELL__)
@@ -61,7 +60,7 @@ mkWeakIORef r@(IORef (STRef r#)) f = IO $ \s ->
-- |Mutate the contents of an 'IORef'
modifyIORef :: IORef a -> (a -> a) -> IO ()
-modifyIORef ref f = writeIORef ref . f =<< readIORef ref
+modifyIORef ref f = readIORef ref >>= writeIORef ref . f
-- |Atomically modifies the contents of an 'IORef'.
diff --git a/libraries/base/Data/Typeable.hs b/libraries/base/Data/Typeable.hs
index 293564e858..5decb80107 100644
--- a/libraries/base/Data/Typeable.hs
+++ b/libraries/base/Data/Typeable.hs
@@ -101,8 +101,7 @@ import GHC.IOBase (IORef,newIORef,unsafePerformIO)
-- These imports are so we can define Typeable instances
-- It'd be better to give Typeable instances in the modules themselves
-- but they all have to be compiled before Typeable
-import GHC.IOBase ( IO, MVar, Exception, ArithException, IOException,
- ArrayException, AsyncException, Handle, block )
+import GHC.IOBase ( IO, MVar, Handle, block )
import GHC.ST ( ST )
import GHC.STRef ( STRef )
import GHC.Ptr ( Ptr, FunPtr )
@@ -495,11 +494,6 @@ INSTANCE_TYPEABLE1(IO,ioTc,"IO")
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
-- Types defined in GHC.IOBase
INSTANCE_TYPEABLE1(MVar,mvarTc,"MVar" )
-INSTANCE_TYPEABLE0(Exception,exceptionTc,"Exception")
-INSTANCE_TYPEABLE0(IOException,ioExceptionTc,"IOException")
-INSTANCE_TYPEABLE0(ArithException,arithExceptionTc,"ArithException")
-INSTANCE_TYPEABLE0(ArrayException,arrayExceptionTc,"ArrayException")
-INSTANCE_TYPEABLE0(AsyncException,asyncExceptionTc,"AsyncException")
#endif
-- Types defined in GHC.Arr
diff --git a/libraries/base/Data/Typeable.hs-boot b/libraries/base/Data/Typeable.hs-boot
index 057468e5b7..45be319ada 100644
--- a/libraries/base/Data/Typeable.hs-boot
+++ b/libraries/base/Data/Typeable.hs-boot
@@ -5,7 +5,6 @@ module Data.Typeable where
import Data.Maybe
import GHC.Base
-import {-# SOURCE #-} GHC.IOBase
import GHC.Show
data TypeRep
@@ -20,5 +19,3 @@ cast :: (Typeable a, Typeable b) => a -> Maybe b
class Typeable a where
typeOf :: a -> TypeRep
-instance Typeable Exception
-