summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorralf <unknown>2004-12-23 00:02:42 +0000
committerralf <unknown>2004-12-23 00:02:42 +0000
commit097b24384a2e561fca70a6b3c4098b9e96196434 (patch)
tree68bb9f7cc67899a27f39e7fde5d74c3f8dcd3442
parent554bbc180ff1f404d149501f66c0dd2a6fa1d941 (diff)
downloadhaskell-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
-rw-r--r--libraries/base/Data/Generics/Text.hs4
-rw-r--r--libraries/base/Data/Tree.hs4
-rw-r--r--libraries/base/Foreign/ForeignPtr.hs2
-rw-r--r--libraries/base/Foreign/Marshal/Alloc.hs6
-rw-r--r--libraries/base/Foreign/Marshal/Array.hs12
-rw-r--r--libraries/base/Foreign/Marshal/Pool.hs8
-rw-r--r--libraries/base/GHC/ForeignPtr.hs2
7 files changed, 19 insertions, 19 deletions
diff --git a/libraries/base/Data/Generics/Text.hs b/libraries/base/Data/Generics/Text.hs
index 1ad767fafe..61ad5a75ff 100644
--- a/libraries/base/Data/Generics/Text.hs
+++ b/libraries/base/Data/Generics/Text.hs
@@ -68,7 +68,7 @@ gread = readP_to_S gread'
where
-- Helper for recursive read
- gread' :: Data a => ReadP a
+ gread' :: Data a' => ReadP a'
gread' = allButString `extR` stringCase
where
@@ -80,7 +80,7 @@ gread = readP_to_S gread'
-- Determine result type
myDataType = dataTypeOf (getArg allButString)
where
- getArg :: ReadP a -> a
+ getArg :: ReadP a'' -> a''
getArg = undefined
-- The generic default for gread
diff --git a/libraries/base/Data/Tree.hs b/libraries/base/Data/Tree.hs
index b9d2c54d72..5d91af8470 100644
--- a/libraries/base/Data/Tree.hs
+++ b/libraries/base/Data/Tree.hs
@@ -116,7 +116,7 @@ unfoldTreeM_BF f b = liftM (fst . fromJust . deQueue) $
-- by Chris Okasaki, /ICFP'00/.
unfoldForestM_BF :: Monad m => (b -> m (a, [b])) -> [b] -> m (Forest a)
unfoldForestM_BF f = liftM (reverseOnto []) . unfoldForestQ f . listToQueue
- where reverseOnto :: [a] -> Queue a -> [a]
+ where reverseOnto :: [a'] -> Queue a' -> [a']
reverseOnto as q = case deQueue q of
Nothing -> as
Just (a, q') -> reverseOnto (a:as) q'
@@ -131,7 +131,7 @@ unfoldForestQ f aQ = case deQueue aQ of
tQ <- unfoldForestQ f (foldl addToQueue aQ as)
let (ts, tQ') = splitOnto [] as tQ
return (addToQueue tQ' (Node b ts))
- where splitOnto :: [a] -> [b] -> Queue a -> ([a], Queue a)
+ where splitOnto :: [a'] -> [b'] -> Queue a' -> ([a'], Queue a')
splitOnto as [] q = (as, q)
splitOnto as (_:bs) q = case fromJust (deQueue q) of
(a, q') -> splitOnto (a:as) bs q'
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.
diff --git a/libraries/base/GHC/ForeignPtr.hs b/libraries/base/GHC/ForeignPtr.hs
index 355d7a1e64..a418efcede 100644
--- a/libraries/base/GHC/ForeignPtr.hs
+++ b/libraries/base/GHC/ForeignPtr.hs
@@ -106,7 +106,7 @@ mallocForeignPtr :: Storable a => IO (ForeignPtr a)
-- assume that the memory returned by 'mallocForeignPtr' has been
-- allocated with 'Foreign.Marshal.Alloc.malloc'.
mallocForeignPtr = doMalloc undefined
- where doMalloc :: Storable a => a -> IO (ForeignPtr a)
+ where doMalloc :: Storable b => b -> IO (ForeignPtr b)
doMalloc a = do
r <- newIORef []
IO $ \s ->