X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FArray%2FIO.hs;h=82b6a22cda02593c8417ab4ce348f5179d04164f;hb=4ff607f73bb8d0c32b24bef858610cbdfa85b899;hp=9074a2a21a3e1be69e721b75b0243a95e2350619;hpb=c7b4eba251450f71914238c406d5eb7d58181207;p=ghc-base.git diff --git a/Data/Array/IO.hs b/Data/Array/IO.hs index 9074a2a..82b6a22 100644 --- a/Data/Array/IO.hs +++ b/Data/Array/IO.hs @@ -46,8 +46,6 @@ import Hugs.IOArray #endif #ifdef __GLASGOW_HASKELL__ --- GHC only to the end of file - import Foreign.C import Foreign.Ptr ( Ptr, FunPtr ) import Foreign.StablePtr ( StablePtr ) @@ -63,6 +61,27 @@ import GHC.Handle import GHC.Conc import GHC.Base +#endif /* __GLASGOW_HASKELL__ */ + +#ifdef __HUGS__ +instance HasBounds IOArray where + bounds = boundsIOArray + +instance MArray IOArray e IO where + newArray = newIOArray + unsafeRead = unsafeReadIOArray + unsafeWrite = unsafeWriteIOArray +#endif /* __HUGS__ */ + +iOArrayTc :: TyCon +iOArrayTc = mkTyCon "IOArray" + +instance (Typeable a, Typeable b) => Typeable (IOArray a b) where + typeOf a = mkAppTy iOArrayTc [typeOf ((undefined :: IOArray a b -> a) a), + typeOf ((undefined :: IOArray a b -> b) a)] + +#ifdef __GLASGOW_HASKELL__ +-- GHC only to the end of file ----------------------------------------------------------------------------- -- | Mutable, boxed, non-strict arrays in the 'IO' monad. The type @@ -74,13 +93,6 @@ import GHC.Base -- newtype IOArray i e = IOArray (STArray RealWorld i e) deriving Eq -iOArrayTc :: TyCon -iOArrayTc = mkTyCon "IOArray" - -instance (Typeable a, Typeable b) => Typeable (IOArray a b) where - typeOf a = mkAppTy iOArrayTc [typeOf ((undefined :: IOArray a b -> a) a), - typeOf ((undefined :: IOArray a b -> b) a)] - instance HasBounds IOArray where {-# INLINE bounds #-} bounds (IOArray marr) = bounds marr