array 0.3.0.2 → 0.3.0.3
raw patch · 4 files changed
+21/−29 lines, 4 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.Array: data Ix i => Array i e :: * -> * -> *
+ Data.Array: data Array i e :: * -> * -> *
- Data.Array.IArray: data Ix i => Array i e :: * -> * -> *
+ Data.Array.IArray: data Array i e :: * -> * -> *
Files
- Data/Array/Base.hs +2/−2
- Data/Array/IO.hs +5/−5
- array.cabal +5/−3
- include/Typeable.h +9/−19
Data/Array/Base.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -XNoBangPatterns -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -XBangPatterns -fno-warn-unused-imports #-} {-# OPTIONS_HADDOCK hide #-} -- XXX With a GHC 6.9 we get a spurious -- Data/Array/Base.hs:26:0:@@ -295,7 +295,7 @@ {-# INLINE (!) #-} -- | Returns the element of an immutable array at the specified index. (!) :: (IArray a e, Ix i) => a i e -> i -> e-arr ! i = case bounds arr of+(!) arr i = case bounds arr of (l,u) -> unsafeAt arr $ safeIndex (l,u) (numElements arr) i {-# INLINE indices #-}
Data/Array/IO.hs view
@@ -74,8 +74,8 @@ -- we would like to read directly into the buffer, but we can't -- be sure that the MutableByteArray# is pinned, so we have to -- allocate a separate area of memory and copy.- allocaBytes n $ \p -> do- r <- hGetBuf handle p n+ allocaBytes count $ \p -> do+ r <- hGetBuf handle p count memcpy_ba_ptr ptr p (fromIntegral r) return r @@ -98,9 +98,9 @@ | otherwise = do -- as in hGetArray, we would like to use the array directly, but -- we can't be sure that the MutableByteArray# is pinned.- allocaBytes n $ \p -> do- memcpy_ptr_ba p raw (fromIntegral n)- hPutBuf handle p n+ allocaBytes count $ \p -> do+ memcpy_ptr_ba p raw (fromIntegral count)+ hPutBuf handle p count foreign import ccall unsafe "memcpy" memcpy_ptr_ba :: Ptr a -> MutableByteArray# RealWorld -> CSize -> IO (Ptr ())
array.cabal view
@@ -1,5 +1,5 @@ name: array-version: 0.3.0.2+version: 0.3.0.3 license: BSD3 license-file: LICENSE maintainer: libraries@haskell.org@@ -15,8 +15,8 @@ extra-source-files: include/Typeable.h source-repository head- type: darcs- location: http://darcs.haskell.org/packages/array/+ type: git+ location: http://darcs.haskell.org/packages/array.git/ library build-depends: base >= 4.2 && < 5@@ -40,6 +40,8 @@ TypeSynonymInstances if impl(ghc) extensions:+ DeriveDataTypeable,+ StandaloneDeriving, Rank2Types, MagicHash, UnboxedTuples,
include/Typeable.h view
@@ -14,32 +14,22 @@ #ifndef TYPEABLE_H #define TYPEABLE_H -#define INSTANCE_TYPEABLE0(tycon,tcname,str) \-tcname :: TyCon; \-tcname = mkTyCon str; \-instance Typeable tycon where { typeOf _ = mkTyConApp tcname [] }- #ifdef __GLASGOW_HASKELL__ --- // For GHC, the extra instances follow from general instance declarations--- // defined in Data.Typeable.+-- // For GHC, we can use DeriveDataTypeable + StandaloneDeriving to+-- // generate the instances. -#define INSTANCE_TYPEABLE1(tycon,tcname,str) \-tcname :: TyCon; \-tcname = mkTyCon str; \-instance Typeable1 tycon where { typeOf1 _ = mkTyConApp tcname [] }+#define INSTANCE_TYPEABLE0(tycon,tcname,str) deriving instance Typeable tycon+#define INSTANCE_TYPEABLE1(tycon,tcname,str) deriving instance Typeable1 tycon+#define INSTANCE_TYPEABLE2(tycon,tcname,str) deriving instance Typeable2 tycon+#define INSTANCE_TYPEABLE3(tycon,tcname,str) deriving instance Typeable3 tycon -#define INSTANCE_TYPEABLE2(tycon,tcname,str) \-tcname :: TyCon; \-tcname = mkTyCon str; \-instance Typeable2 tycon where { typeOf2 _ = mkTyConApp tcname [] }+#else /* !__GLASGOW_HASKELL__ */ -#define INSTANCE_TYPEABLE3(tycon,tcname,str) \+#define INSTANCE_TYPEABLE0(tycon,tcname,str) \ tcname :: TyCon; \ tcname = mkTyCon str; \-instance Typeable3 tycon where { typeOf3 _ = mkTyConApp tcname [] }--#else /* !__GLASGOW_HASKELL__ */+instance Typeable tycon where { typeOf _ = mkTyConApp tcname [] } #define INSTANCE_TYPEABLE1(tycon,tcname,str) \ tcname = mkTyCon str; \