{-# INLINE unsafeAccumArray #-}
unsafeAccumArray f init lu ies = runST (unsafeAccumArrayUArray f init lu ies)
-#ifdef __GLASGOW_HASKELL__
instance IArray UArray Word where
{-# INLINE unsafeArray #-}
unsafeArray lu ies = runST (unsafeArrayUArray lu ies 0)
+#ifdef __GLASGOW_HASKELL__
{-# INLINE unsafeAt #-}
unsafeAt (UArray _ _ arr#) (I# i#) = W# (indexWordArray# arr# i#)
+#endif
+#ifdef __HUGS__
+ unsafeAt = unsafeAtBArray
+#endif
{-# INLINE unsafeReplace #-}
unsafeReplace arr ies = runST (unsafeReplaceUArray arr ies)
{-# INLINE unsafeAccum #-}
unsafeAccum f arr ies = runST (unsafeAccumUArray f arr ies)
{-# INLINE unsafeAccumArray #-}
unsafeAccumArray f init lu ies = runST (unsafeAccumArrayUArray f init lu ies)
-#endif
instance IArray UArray (Ptr a) where
{-# INLINE unsafeArray #-}
instance Ix ix => Eq (UArray ix Int) where
(==) = eqUArray
-#ifdef __GLASGOW_HASKELL__
instance Ix ix => Eq (UArray ix Word) where
(==) = eqUArray
-#endif
instance Ix ix => Eq (UArray ix (Ptr a)) where
(==) = eqUArray
instance Ix ix => Ord (UArray ix Int) where
compare = cmpUArray
-#ifdef __GLASGOW_HASKELL__
instance Ix ix => Ord (UArray ix Word) where
compare = cmpUArray
-#endif
instance Ix ix => Ord (UArray ix (Ptr a)) where
compare = cmpUArray
instance (Ix ix, Show ix) => Show (UArray ix Int) where
showsPrec = showsIArray
-#ifdef __GLASGOW_HASKELL__
instance (Ix ix, Show ix) => Show (UArray ix Word) where
showsPrec = showsIArray
-#endif
instance (Ix ix, Show ix) => Show (UArray ix Float) where
showsPrec = showsIArray
unsafeRead = unsafeReadMBArray
unsafeWrite = unsafeWriteMBArray
+instance MArray (STUArray s) Word (ST s) where
+ newArray_ = newMBArray_
+ unsafeRead = unsafeReadMBArray
+ unsafeWrite = unsafeWriteMBArray
+
instance MArray (STUArray s) (Ptr a) (ST s) where
newArray_ = newMBArray_
unsafeRead = unsafeReadMBArray
instance (Ix ix, Show ix) => Show (DiffUArray ix Int) where
showsPrec = showsIArray
-#ifdef __GLASGOW_HASKELL__
instance (Ix ix, Show ix) => Show (DiffUArray ix Word) where
showsPrec = showsIArray
-#endif
instance (Ix ix, Show ix) => Show (DiffUArray ix Float) where
showsPrec = showsIArray
unsafeAt a i = unsafePerformIO $ a `readDiffArray` i
unsafeReplace a ies = unsafePerformIO $ a `replaceDiffArray2` ies
-#ifdef __GLASGOW_HASKELL__
instance IArray (IOToDiffArray IOUArray) Word where
unsafeArray lu ies = unsafePerformIO $ newDiffArray lu ies
unsafeAt a i = unsafePerformIO $ a `readDiffArray` i
unsafeReplace a ies = unsafePerformIO $ a `replaceDiffArray2` ies
-#endif
instance IArray (IOToDiffArray IOUArray) (Ptr a) where
unsafeArray lu ies = unsafePerformIO $ newDiffArray lu ies
{-# INLINE unsafeWrite #-}
unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)
-#ifdef __GLASGOW_HASKELL__
instance MArray IOUArray Word IO where
{-# INLINE newArray #-}
newArray lu init = stToIO $ do
unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)
{-# INLINE unsafeWrite #-}
unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)
-#endif
instance MArray IOUArray (Ptr a) IO where
{-# INLINE newArray #-}
INSTANCE_TYPEABLE0(Float,floatTc,"Float")
INSTANCE_TYPEABLE0(Double,doubleTc,"Double")
INSTANCE_TYPEABLE0(Int,intTc,"Int")
+#ifndef __NHC__
+INSTANCE_TYPEABLE0(Word,wordTc,"Word" )
+#endif
INSTANCE_TYPEABLE0(Integer,integerTc,"Integer")
INSTANCE_TYPEABLE0(Ordering,orderingTc,"Ordering")
INSTANCE_TYPEABLE0(Handle,handleTc,"Handle")
#ifdef __GLASGOW_HASKELL__
INSTANCE_TYPEABLE0(RealWorld,realWorldTc,"RealWorld")
-INSTANCE_TYPEABLE0(Word,wordTc,"Word" )
INSTANCE_TYPEABLE1(MVar,mvarTc,"MVar" )
#endif
STORABLE(Int,SIZEOF_HSINT,ALIGNMENT_HSINT,
readIntOffPtr,writeIntOffPtr)
-#ifdef __GLASGOW_HASKELL__
+#ifndef __NHC__
STORABLE(Word,SIZEOF_HSWORD,ALIGNMENT_HSWORD,
readWordOffPtr,writeWordOffPtr)
#endif