1 -- compiled to produce a 1.3 (whatever that is) Prelude.hi file
5 -- 1.3 extras (I/O is later)
11 -- NO: really builtin (0.20+): trace,
13 (%), numerator, denominator, approxRational,
15 realPart, imagPart, conjugate, mkPolar, cis,
16 polar, magnitude, phase,
18 _appendPS, _breakPS, _concatPS, _dropPS, _dropWhilePS,
19 _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS,
20 _linesPS, _mapPS, _nilPS, _consPS, _nullPS, _packCBytes,
21 _packCString, _packString, _byteArrayToPS, _psToByteArray,
22 _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS,
23 _takeWhilePS, _unpackPS, _wordsPS, _putPS,
25 (&&), (||), not, otherwise,
26 (^), (^^), appendBin, asTypeOf, atan2, fromIntegral,
27 fromRealFrac, gcd, isAlpha, isAlphanum, isAscii, isControl,
28 isDigit, isLower, isNullBin, isPrint, isSpace, isUpper, lcm,
29 maxChar, maxInt, minChar, minInt, nullBin, subtract, toLower,
30 toUpper, until, fst, snd, id, const, (.), flip, ($),
33 #if defined(__UNBOXED_INSTANCES__)
38 isAscii#, isControl#, isPrint#, isSpace#,
39 isUpper#, isLower#, isAlpha#, isDigit#, isAlphanum#,
43 head, last, tail, init, null, (++), (\\), genericLength,
44 length, (!!), map, filter, partition, {-BUILTIN: foldl,-}
45 foldl1, scanl, scanl1, {-BUILTIN: foldr,-} foldr1, scanr, scanr1,
46 iterate, repeat, cycle, take, drop, splitAt, takeWhile,
47 dropWhile, span, break, lines, words, unlines, unwords, nub,
48 reverse, and, or, any, all, elem, notElem, sum,
49 product, sums, products, maximum, minimum, concat,
50 transpose, zip, zip3, zip4, zip5, zip6, zip7, zipWith,
51 zipWith3, zipWith4, zipWith5, zipWith6, zipWith7, unzip,
52 unzip3, unzip4, unzip5, unzip6, unzip7,
54 array, listArray, (!), bounds, indices, elems, assocs,
55 accumArray, (//), accum, amap, ixmap,
57 reads, shows, show, read, lex, showChar, showString,
58 readParen, showParen, readLitChar, showLitChar, readSigned,
59 showSigned, showSpace__, readDec, showInt, readFloat, showFloat,
60 _showHex, _showRadix, _showDigit, -- non-std
63 _readRational, _showRational, -- extras!
65 -- 1.3 I/O stuff from PreludeIO, some *renamed*
114 primIOToIO, ioToPrimIO, -- extra, and very dodgy
116 -- and for foldr/build
121 -- few *Ty(s) imports
122 import TyArray ( Array(..), Assoc(..), _ByteArray )
123 import TyComplex ( Complex(..) )
124 --import Builtin ( trace )
125 import Cls hiding ( String )
127 import PreludeGlaST ( thenStrictlyST, _MutableByteArray, _MutableArray )
128 import PreludePrimIO ( thenPrimIO, returnPrimIO )
150 import PreludeIO renaming ( -- IOError13 to IOError -- can't rename PreludeCore types
151 appendFile13 to appendFile
152 , interact13 to interact
154 , readFile13 to readFile
158 , writeFile13 to writeFile
161 primIOToIO :: PrimIO a -> IO a
162 primIOToIO m = m `thenPrimIO` \ a -> return a
164 ioToPrimIO :: IO a -> PrimIO a
166 = io `thenPrimIO` \ r ->
168 Right a -> returnPrimIO a
169 Left e -> error ("I/O Error (ioToPrimIO): " ++ showsPrec 0 e "\n")
172 -- 1.3 extra functions
174 thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
175 thenMaybe Nothing _ = Nothing
176 thenMaybe (Just x) f = f x
178 curry :: ((a,b) -> c) -> a -> b -> c
179 curry f x y = f (x,y)
181 uncurry :: (a -> b -> c) -> (a,b) -> c
182 uncurry f (x,y) = f x y
185 copy :: Int -> a -> [a]
186 copy n x = take n (repeat x)
188 lookup :: Eq a => [(a,b)] -> a -> Maybe b
189 lookup [] _ = Nothing
190 lookup ((key,val) : rest) x | key == x = Just val
191 | otherwise = lookup rest x