diff options
author | ralf <unknown> | 2004-12-23 00:02:42 +0000 |
---|---|---|
committer | ralf <unknown> | 2004-12-23 00:02:42 +0000 |
commit | 097b24384a2e561fca70a6b3c4098b9e96196434 (patch) | |
tree | 68bb9f7cc67899a27f39e7fde5d74c3f8dcd3442 /libraries/base/Foreign | |
parent | 554bbc180ff1f404d149501f66c0dd2a6fa1d941 (diff) | |
download | haskell-097b24384a2e561fca70a6b3c4098b9e96196434.tar.gz |
[project @ 2004-12-23 00:02:41 by ralf]
Resolved stage1 issues related SPJ's
commit "Add more scoped type variables".
Incidentally, this provides some input for
the recent GHC list discussion on whether
to provide lex. scope for function signatures.
Not too many modules are affected! Good!
The example hslibs/data/edison/Seq/BinaryRandList.hs
was interesting in so far that indeed up-front
function signatures were given in one shot, so
one is really a bit confused to see type variables
in where clauses to clash with far-removed top-level
function signatures.
Ralf
Diffstat (limited to 'libraries/base/Foreign')
-rw-r--r-- | libraries/base/Foreign/ForeignPtr.hs | 2 | ||||
-rw-r--r-- | libraries/base/Foreign/Marshal/Alloc.hs | 6 | ||||
-rw-r--r-- | libraries/base/Foreign/Marshal/Array.hs | 12 | ||||
-rw-r--r-- | libraries/base/Foreign/Marshal/Pool.hs | 8 |
4 files changed, 14 insertions, 14 deletions
diff --git a/libraries/base/Foreign/ForeignPtr.hs b/libraries/base/Foreign/ForeignPtr.hs index a0bccf59b8..63e0b25f72 100644 --- a/libraries/base/Foreign/ForeignPtr.hs +++ b/libraries/base/Foreign/ForeignPtr.hs @@ -174,7 +174,7 @@ mallocForeignPtrBytes n = do mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a) mallocForeignPtrArray = doMalloc undefined where - doMalloc :: Storable a => a -> Int -> IO (ForeignPtr a) + doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b) doMalloc dummy size = mallocForeignPtrBytes (size * sizeOf dummy) -- | This function is similar to 'Foreign.Marshal.Array.mallocArray0', diff --git a/libraries/base/Foreign/Marshal/Alloc.hs b/libraries/base/Foreign/Marshal/Alloc.hs index dbd3644a3d..65588ff76b 100644 --- a/libraries/base/Foreign/Marshal/Alloc.hs +++ b/libraries/base/Foreign/Marshal/Alloc.hs @@ -68,7 +68,7 @@ import Hugs.ForeignPtr ( FinalizerPtr ) malloc :: Storable a => IO (Ptr a) malloc = doMalloc undefined where - doMalloc :: Storable a => a -> IO (Ptr a) + doMalloc :: Storable b => b -> IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy) -- |Allocate a block of memory of the given number of bytes. @@ -91,7 +91,7 @@ mallocBytes size = failWhenNULL "malloc" (_malloc (fromIntegral size)) alloca :: Storable a => (Ptr a -> IO b) -> IO b alloca = doAlloca undefined where - doAlloca :: Storable a => a -> (Ptr a -> IO b) -> IO b + doAlloca :: Storable a' => a' -> (Ptr a' -> IO b') -> IO b' doAlloca dummy = allocaBytes (sizeOf dummy) -- |@'allocaBytes' n f@ executes the computation @f@, passing as argument @@ -131,7 +131,7 @@ allocaBytes size = bracket (mallocBytes size) free realloc :: Storable b => Ptr a -> IO (Ptr b) realloc = doRealloc undefined where - doRealloc :: Storable b => b -> Ptr a -> IO (Ptr b) + doRealloc :: Storable b' => b' -> Ptr a' -> IO (Ptr b') doRealloc dummy ptr = let size = fromIntegral (sizeOf dummy) in diff --git a/libraries/base/Foreign/Marshal/Array.hs b/libraries/base/Foreign/Marshal/Array.hs index a28ccc8027..787c37deff 100644 --- a/libraries/base/Foreign/Marshal/Array.hs +++ b/libraries/base/Foreign/Marshal/Array.hs @@ -85,7 +85,7 @@ import GHC.Base mallocArray :: Storable a => Int -> IO (Ptr a) mallocArray = doMalloc undefined where - doMalloc :: Storable a => a -> Int -> IO (Ptr a) + doMalloc :: Storable a' => a' -> Int -> IO (Ptr a') doMalloc dummy size = mallocBytes (size * sizeOf dummy) -- |Like 'mallocArray', but add an extra position to hold a special @@ -100,7 +100,7 @@ mallocArray0 size = mallocArray (size + 1) allocaArray :: Storable a => Int -> (Ptr a -> IO b) -> IO b allocaArray = doAlloca undefined where - doAlloca :: Storable a => a -> Int -> (Ptr a -> IO b) -> IO b + doAlloca :: Storable a' => a' -> Int -> (Ptr a' -> IO b') -> IO b' doAlloca dummy size = allocaBytes (size * sizeOf dummy) -- |Like 'allocaArray', but add an extra position to hold a special @@ -114,7 +114,7 @@ allocaArray0 size = allocaArray (size + 1) reallocArray :: Storable a => Ptr a -> Int -> IO (Ptr a) reallocArray = doRealloc undefined where - doRealloc :: Storable a => a -> Ptr a -> Int -> IO (Ptr a) + doRealloc :: Storable a' => a' -> Ptr a' -> Int -> IO (Ptr a') doRealloc dummy ptr size = reallocBytes ptr (size * sizeOf dummy) -- |Adjust the size of an array including an extra position for the end marker. @@ -237,7 +237,7 @@ withArrayLen0 marker vals f = copyArray :: Storable a => Ptr a -> Ptr a -> Int -> IO () copyArray = doCopy undefined where - doCopy :: Storable a => a -> Ptr a -> Ptr a -> Int -> IO () + doCopy :: Storable a' => a' -> Ptr a' -> Ptr a' -> Int -> IO () doCopy dummy dest src size = copyBytes dest src (size * sizeOf dummy) -- |Copy the given number of elements from the second array (source) into the @@ -246,7 +246,7 @@ copyArray = doCopy undefined moveArray :: Storable a => Ptr a -> Ptr a -> Int -> IO () moveArray = doMove undefined where - doMove :: Storable a => a -> Ptr a -> Ptr a -> Int -> IO () + doMove :: Storable a' => a' -> Ptr a' -> Ptr a' -> Int -> IO () doMove dummy dest src size = moveBytes dest src (size * sizeOf dummy) @@ -271,5 +271,5 @@ lengthArray0 marker ptr = loop 0 advancePtr :: Storable a => Ptr a -> Int -> Ptr a advancePtr = doAdvance undefined where - doAdvance :: Storable a => a -> Ptr a -> Int -> Ptr a + doAdvance :: Storable a' => a' -> Ptr a' -> Int -> Ptr a' doAdvance dummy ptr i = ptr `plusPtr` (i * sizeOf dummy) diff --git a/libraries/base/Foreign/Marshal/Pool.hs b/libraries/base/Foreign/Marshal/Pool.hs index 2804a709f8..f182d19314 100644 --- a/libraries/base/Foreign/Marshal/Pool.hs +++ b/libraries/base/Foreign/Marshal/Pool.hs @@ -116,7 +116,7 @@ withPool = bracket newPool freePool pooledMalloc :: Storable a => Pool -> IO (Ptr a) pooledMalloc = pm undefined where - pm :: Storable a => a -> Pool -> IO (Ptr a) + pm :: Storable a' => a' -> Pool -> IO (Ptr a') pm dummy pool = pooledMallocBytes pool (sizeOf dummy) -- | Allocate the given number of bytes of storage in the pool. @@ -134,7 +134,7 @@ pooledMallocBytes (Pool pool) size = do pooledRealloc :: Storable a => Pool -> Ptr a -> IO (Ptr a) pooledRealloc = pr undefined where - pr :: Storable a => a -> Pool -> Ptr a -> IO (Ptr a) + pr :: Storable a' => a' -> Pool -> Ptr a' -> IO (Ptr a') pr dummy pool ptr = pooledReallocBytes pool ptr (sizeOf dummy) -- | Adjust the storage area for an element in the pool to the given size. @@ -154,7 +154,7 @@ pooledReallocBytes (Pool pool) ptr size = do pooledMallocArray :: Storable a => Pool -> Int -> IO (Ptr a) pooledMallocArray = pma undefined where - pma :: Storable a => a -> Pool -> Int -> IO (Ptr a) + pma :: Storable a' => a' -> Pool -> Int -> IO (Ptr a') pma dummy pool size = pooledMallocBytes pool (size * sizeOf dummy) -- | Allocate storage for the given number of elements of a storable type in the @@ -169,7 +169,7 @@ pooledMallocArray0 pool size = pooledReallocArray :: Storable a => Pool -> Ptr a -> Int -> IO (Ptr a) pooledReallocArray = pra undefined where - pra :: Storable a => a -> Pool -> Ptr a -> Int -> IO (Ptr a) + pra :: Storable a' => a' -> Pool -> Ptr a' -> Int -> IO (Ptr a') pra dummy pool ptr size = pooledReallocBytes pool ptr (size * sizeOf dummy) -- | Adjust the size of an array with an end marker in the given pool. |