diff options
Diffstat (limited to 'ghc/lib/std')
-rw-r--r-- | ghc/lib/std/Main.hi-boot | 2 | ||||
-rw-r--r-- | ghc/lib/std/PrelErr.hi-boot | 2 | ||||
-rw-r--r-- | ghc/lib/std/PrelException.hi-boot | 6 | ||||
-rw-r--r-- | ghc/lib/std/PrelGHC.hi-boot | 24 | ||||
-rw-r--r-- | ghc/lib/std/PrelList.lhs | 11 | ||||
-rw-r--r-- | ghc/lib/std/PrelPack.hi-boot | 2 | ||||
-rw-r--r-- | ghc/lib/std/PrelShow.lhs | 1 |
7 files changed, 35 insertions, 13 deletions
diff --git a/ghc/lib/std/Main.hi-boot b/ghc/lib/std/Main.hi-boot index d93b977f4f..844073fda0 100644 --- a/ghc/lib/std/Main.hi-boot +++ b/ghc/lib/std/Main.hi-boot @@ -8,6 +8,6 @@ __interface Main 1 where __export Main main ; -1 main :: __forall [a] => PrelIOBase.IO a; -- wish this could be __o. KSW 1999-04. +1 main :: __forall a => PrelIOBase.IO a; -- wish this could be __o. KSW 1999-04. diff --git a/ghc/lib/std/PrelErr.hi-boot b/ghc/lib/std/PrelErr.hi-boot index bd7f8f9f01..98d97219e9 100644 --- a/ghc/lib/std/PrelErr.hi-boot +++ b/ghc/lib/std/PrelErr.hi-boot @@ -7,6 +7,6 @@ -- because it's wired into the compiler --------------------------------------------------------------------------- -__interface PrelErr 2 0 where +__interface PrelErr 1 where __export PrelErr error parError; diff --git a/ghc/lib/std/PrelException.hi-boot b/ghc/lib/std/PrelException.hi-boot index 511010d4bf..9be1ea3779 100644 --- a/ghc/lib/std/PrelException.hi-boot +++ b/ghc/lib/std/PrelException.hi-boot @@ -5,8 +5,8 @@ -- for PrelException.hi. --------------------------------------------------------------------------- -__interface PrelException 1 0 where +__interface PrelException 1 where __export PrelException ioError catch; -1 ioError :: __forall [a] => PrelIOBase.IOError -> PrelIOBase.IO a ; -1 catch :: __forall [a] => PrelIOBase.IO a -> (PrelIOBase.IOError -> PrelIOBase.IO a) -> PrelIOBase.IO a ; -- wish there could be more __o's here. KSW 1999-04. +1 ioError :: __forall a => PrelIOBase.IOError -> PrelIOBase.IO a ; +1 catch :: __forall a => PrelIOBase.IO a -> (PrelIOBase.IOError -> PrelIOBase.IO a) -> PrelIOBase.IO a ; -- wish there could be more __o's here. KSW 1999-04. diff --git a/ghc/lib/std/PrelGHC.hi-boot b/ghc/lib/std/PrelGHC.hi-boot index bc7dac3927..dedb4de5ce 100644 --- a/ghc/lib/std/PrelGHC.hi-boot +++ b/ghc/lib/std/PrelGHC.hi-boot @@ -5,7 +5,7 @@ -- primitive operations and types that GHC knows about. --------------------------------------------------------------------------- -__interface "std" PrelGHC 2 0 where +__interface "std" PrelGHC 1 407 where __export PrelGHC @@ -341,6 +341,18 @@ __export PrelGHC unsafeCoercezh ; +-- Export PrelErr.error, so that others don't have to import PrelErr +__export PrelErr error ; + +-------------------------------------------------- +-- These imports tell modules low down in the hierarchy that +-- PrelErr and PrelBase are in the same package and +-- should be read from their hi-boot files +import PrelErr @ ; +import PrelNum @ ; + + +-------------------------------------------------- instance {CCallable Charzh} = zdfCCallableCharzh; instance {CCallable Doublezh} = zdfCCallableDoublezh; instance {CCallable Floatzh} = zdfCCallableFloatzh; @@ -350,15 +362,15 @@ instance {CCallable Int64zh} = zdfCCallableInt64zh; instance {CCallable Word64zh} = zdfCCallableWord64zh; instance {CCallable Wordzh} = zdfCCallableWordzh; instance {CCallable ByteArrayzh} = zdfCCallableByteArrayzh; -instance __forall [s] => {CCallable (MutableByteArrayzh s)} = zdfCCallableMutableByteArrayzh; +instance __forall s => {CCallable (MutableByteArrayzh s)} = zdfCCallableMutableByteArrayzh; instance {CCallable ForeignObjzh} = zdfCCallableForeignObjzh; -instance __forall [s] => {CCallable (StablePtrzh s)} = zdfCCallableStablePtrzh; +instance __forall s => {CCallable (StablePtrzh s)} = zdfCCallableStablePtrzh; -- CCallable and CReturnable have kind (Type AnyBox) so that -- things like Int# can be instances of CCallable. 1 class CCallable a :: ? ; 1 class CReturnable a :: ? ; -1 assert :: __forall [a] => PrelBase.Bool -> a -> a ; +1 assert :: __forall a => PrelBase.Bool -> a -> a ; -- These guys don't really exist: -- @@ -371,6 +383,6 @@ instance __forall [s] => {CCallable (StablePtrzh s)} = zdfCCallableStablePtrzh; 1 zdfCCallableWord64zh :: {CCallable Word64zh} ; 1 zdfCCallableWordzh :: {CCallable Wordzh} ; 1 zdfCCallableByteArrayzh :: {CCallable ByteArrayzh} ; -1 zdfCCallableMutableByteArrayzh :: __forall [s] => {CCallable (MutableByteArrayzh s)} ; +1 zdfCCallableMutableByteArrayzh :: __forall s => {CCallable (MutableByteArrayzh s)} ; 1 zdfCCallableForeignObjzh :: {CCallable ForeignObjzh} ; -1 zdfCCallableStablePtrzh :: __forall [a] => {CCallable (StablePtrzh a)} ; +1 zdfCCallableStablePtrzh :: __forall a => {CCallable (StablePtrzh a)} ; diff --git a/ghc/lib/std/PrelList.lhs b/ghc/lib/std/PrelList.lhs index 1ea90d6d13..dcc0c81b3c 100644 --- a/ghc/lib/std/PrelList.lhs +++ b/ghc/lib/std/PrelList.lhs @@ -21,7 +21,6 @@ module PrelList ( any, all, elem, notElem, lookup, maximum, minimum, concatMap, zip, zip3, zipWith, zipWith3, unzip, unzip3, - #ifdef USE_REPORT_PRELUDE #else @@ -483,6 +482,16 @@ foldr2_right k _z y r (x:xs) = k x y (r xs) #-} \end{code} +The foldr2/right rule isn't exactly right, because it changes +the strictness of foldr2 (and thereby zip) + +E.g. main = print (null (zip nonobviousNil (build undefined))) + where nonobviousNil = f 3 + f n = if n == 0 then [] else f (n-1) + +I'm going to leave it though. + + zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded. zip3 takes three lists and returns a list of triples. Zips for larger diff --git a/ghc/lib/std/PrelPack.hi-boot b/ghc/lib/std/PrelPack.hi-boot index 37908c8537..e7e6f6e550 100644 --- a/ghc/lib/std/PrelPack.hi-boot +++ b/ghc/lib/std/PrelPack.hi-boot @@ -7,7 +7,7 @@ -- other Prelude files that precede PrelPack --------------------------------------------------------------------------- -__interface PrelPack 1 where +__interface PrelPack 1 1 1 where __export PrelPack packCStringzh ; 1 packCStringzh :: [PrelBase.Char] -> PrelGHC.ByteArrayzh ; diff --git a/ghc/lib/std/PrelShow.lhs b/ghc/lib/std/PrelShow.lhs index 44e336482d..a2147ae40f 100644 --- a/ghc/lib/std/PrelShow.lhs +++ b/ghc/lib/std/PrelShow.lhs @@ -31,6 +31,7 @@ module PrelShow import {-# SOURCE #-} PrelErr ( error ) import PrelBase +import PrelTup import PrelMaybe import PrelList ( (!!), break, dropWhile #ifdef USE_REPORT_PRELUDE |