summaryrefslogtreecommitdiff
path: root/ghc/lib/std/PrelGHC.hi-boot
diff options
context:
space:
mode:
authorapt <unknown>2001-08-17 17:18:54 +0000
committerapt <unknown>2001-08-17 17:18:54 +0000
commit1dfaee318171836b32f6b33a14231c69adfdef2f (patch)
tree5a130da45e21740751393ca2dc3bef8ab14db3a2 /ghc/lib/std/PrelGHC.hi-boot
parentd30f8fc14ae1fb699a4b4d2e4bbb03fbc7f88d04 (diff)
downloadhaskell-1dfaee318171836b32f6b33a14231c69adfdef2f.tar.gz
[project @ 2001-08-17 17:18:51 by apt]
How I spent my summer vacation. Primops ------- The format of the primops.txt.pp file has been enhanced to allow (latex-style) primop descriptions to be included. There is a new flag to genprimopcode that generates documentation including these descriptions. A first cut at descriptions of the more interesting primops has been made, and the file has been reordered a bit. 31-bit words ------------ The front end now can cope with the possibility of 31-bit (or even 30-bit) Int# and Word# types. The only current use of this is to generate external .core files that can be translated into OCAML source files (OCAML uses a one-bit tag to distinguish integers from pointers). The only way to get this right now is by hand-defining the preprocessor symbol WORD_SIZE_IN_BITS, which is normally set automatically from the familiar WORD_SIZE_IN_BYTES. Just in case 31-bit words are used, we now have Int32# and Word32# primitive types and an associated family of operators, paralleling the existing 64-bit stuff. Of course, none of the operators actually need to be implemented in the absence of a 31-bit backend. There has also been some minor re-jigging of the 32 vs. 64 bit stuff. See the description at the top of primops.txt.pp file for more details. Note that, for the first time, the *type* of a primop can now depend on the target word size. Also, the family of primops intToInt8#, intToInt16#, etc. have been renamed narrow8Int#, narrow16Int#, etc., to emphasize that they work on Int#'s and don't actually convert between types. Addresses --------- As another part of coping with the possibility of 31-bit ints, the addr2Int# and int2Addr# primops are now thoroughly deprecated (and not even defined in the 31-bit case) and all uses of them have been removed except from the (deprecated) module hslibs/lang/Addr Addr# should now be treated as a proper abstract type, and has these suitable operators: nullAddr# : Int# -> Addr# (ignores its argument; nullary primops cause problems at various places) plusAddr# : Addr# -> Int# -> Addr# minusAddr : Addr# -> Addr# -> Int# remAddr# : Addr# -> Int# -> Int# Obviously, these don't allow completely arbitrary offsets if 31-bit ints are in use, but they should do for all practical purposes. It is also still possible to generate an address constant, and there is a built-in rule that makes use of this to remove the nullAddr# calls. Misc ---- There is a new compile flag -fno-code that causes GHC to quit after generating .hi files and .core files (if requested) but before generating STG. Z-encoded names for tuples have been rationalized; e.g., Z3H now means an unboxed 3-tuple, rather than an unboxed tuple with 3 commas (i.e., a 4-tuple)! Removed misc. litlits in hslibs/lang Misc. small changes to external core format. The external core description has also been substantially updated, and incorporates the automatically-generated primop documentation; its in the repository at /papers/ext-core/core.tex. A little make-system addition to allow passing CPP options to compiler and library builds.
Diffstat (limited to 'ghc/lib/std/PrelGHC.hi-boot')
-rw-r--r--ghc/lib/std/PrelGHC.hi-boot1506
1 files changed, 1506 insertions, 0 deletions
diff --git a/ghc/lib/std/PrelGHC.hi-boot b/ghc/lib/std/PrelGHC.hi-boot
new file mode 100644
index 0000000000..efedce4445
--- /dev/null
+++ b/ghc/lib/std/PrelGHC.hi-boot
@@ -0,0 +1,1506 @@
+---------------------------------------------------------------------------
+-- PrelGHC.hi-boot
+--
+-- This hand-written interface file allows you to bring into scope the
+-- primitive operations and types that GHC knows about.
+---------------------------------------------------------------------------
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+__interface "std" PrelGHC 1 0 where
+
+__export PrelGHC
+
+ ZLzmzgZR -- (->)
+
+ CCallable
+ CReturnable
+
+-- Magical assert thingy
+ assert
+
+ -- constructor tags
+ tagToEnumzh
+ getTagzh
+ dataToTagzh
+
+ -- I/O primitives
+ RealWorld
+ realWorldzh
+ Statezh
+
+ -- Concurrency primitives
+ ThreadIdzh
+ myThreadIdzh
+ forkzh
+ yieldzh
+ killThreadzh
+ blockAsyncExceptionszh
+ unblockAsyncExceptionszh
+ delayzh
+ waitReadzh
+ waitWritezh
+
+ -- MVars
+ MVarzh
+ sameMVarzh
+ newMVarzh
+ takeMVarzh
+ putMVarzh
+ tryTakeMVarzh
+ tryPutMVarzh
+ isEmptyMVarzh
+
+ -- Parallel
+ seqzh
+ parzh
+ parGlobalzh
+ parLocalzh
+ parAtzh
+ parAtAbszh
+ parAtRelzh
+ parAtForNowzh
+
+ -- Character Type
+ Charzh
+ gtCharzh
+ geCharzh
+ eqCharzh
+ neCharzh
+ ltCharzh
+ leCharzh
+ ordzh
+ chrzh
+
+ -- Int Type
+ Intzh
+ zgzh
+ zgzezh
+ zezezh
+ zszezh
+ zlzh
+ zlzezh
+ zpzh
+ zmzh
+ ztzh
+ quotIntzh
+ remIntzh
+ gcdIntzh
+ negateIntzh
+ iShiftLzh
+ iShiftRAzh
+ iShiftRLzh
+ addIntCzh
+ subIntCzh
+ mulIntCzh
+
+ Wordzh
+ gtWordzh
+ geWordzh
+ eqWordzh
+ neWordzh
+ ltWordzh
+ leWordzh
+ plusWordzh
+ minusWordzh
+ timesWordzh
+ quotWordzh
+ remWordzh
+ andzh
+ orzh
+ notzh
+ xorzh
+ shiftLzh
+ shiftRLzh
+ int2Wordzh
+ word2Intzh
+
+ narrow8Intzh
+ narrow16Intzh
+ narrow32Intzh
+ narrow8Wordzh
+ narrow16Wordzh
+ narrow32Wordzh
+
+
+
+
+
+
+
+ Int64zh
+ Word64zh
+
+
+ Addrzh
+ nullAddrzh
+ plusAddrzh
+ minusAddrzh
+ remAddrzh
+
+ addr2Intzh
+ int2Addrzh
+
+ gtAddrzh
+ geAddrzh
+ eqAddrzh
+ neAddrzh
+ ltAddrzh
+ leAddrzh
+
+ Floatzh
+ gtFloatzh
+ geFloatzh
+ eqFloatzh
+ neFloatzh
+ ltFloatzh
+ leFloatzh
+ plusFloatzh
+ minusFloatzh
+ timesFloatzh
+ divideFloatzh
+ negateFloatzh
+ float2Intzh
+ int2Floatzh
+ expFloatzh
+ logFloatzh
+ sqrtFloatzh
+ sinFloatzh
+ cosFloatzh
+ tanFloatzh
+ asinFloatzh
+ acosFloatzh
+ atanFloatzh
+ sinhFloatzh
+ coshFloatzh
+ tanhFloatzh
+ powerFloatzh
+ decodeFloatzh
+
+ Doublezh
+ zgzhzh
+ zgzezhzh
+ zezezhzh
+ zszezhzh
+ zlzhzh
+ zlzezhzh
+ zpzhzh
+ zmzhzh
+ ztzhzh
+ zszhzh
+ negateDoublezh
+ double2Intzh
+ int2Doublezh
+ double2Floatzh
+ float2Doublezh
+ expDoublezh
+ logDoublezh
+ sqrtDoublezh
+ sinDoublezh
+ cosDoublezh
+ tanDoublezh
+ asinDoublezh
+ acosDoublezh
+ atanDoublezh
+ sinhDoublezh
+ coshDoublezh
+ tanhDoublezh
+ ztztzhzh
+ decodeDoublezh
+
+ cmpIntegerzh
+ cmpIntegerIntzh
+ plusIntegerzh
+ minusIntegerzh
+ timesIntegerzh
+ gcdIntegerzh
+ quotIntegerzh
+ remIntegerzh
+ gcdIntegerzh
+ gcdIntegerIntzh
+ divExactIntegerzh
+ quotRemIntegerzh
+ divModIntegerzh
+ integer2Intzh
+ integer2Wordzh
+ int2Integerzh
+ word2Integerzh
+
+
+
+
+
+
+
+ integerToInt64zh
+ integerToWord64zh
+ int64ToIntegerzh
+ word64ToIntegerzh
+
+ andIntegerzh
+ orIntegerzh
+ xorIntegerzh
+ complementIntegerzh
+
+ Arrayzh
+ ByteArrayzh
+ MutableArrayzh
+ MutableByteArrayzh
+ sameMutableArrayzh
+ sameMutableByteArrayzh
+ newArrayzh
+ newByteArrayzh
+ newPinnedByteArrayzh
+ byteArrayContentszh
+
+ indexArrayzh
+ indexCharArrayzh
+ indexWideCharArrayzh
+ indexIntArrayzh
+ indexWordArrayzh
+ indexAddrArrayzh
+ indexFloatArrayzh
+ indexDoubleArrayzh
+ indexStablePtrArrayzh
+ indexInt8Arrayzh
+ indexInt16Arrayzh
+ indexInt32Arrayzh
+ indexInt64Arrayzh
+ indexWord8Arrayzh
+ indexWord16Arrayzh
+ indexWord32Arrayzh
+ indexWord64Arrayzh
+
+ readArrayzh
+ readCharArrayzh
+ readWideCharArrayzh
+ readIntArrayzh
+ readWordArrayzh
+ readAddrArrayzh
+ readFloatArrayzh
+ readDoubleArrayzh
+ readStablePtrArrayzh
+ readInt8Arrayzh
+ readInt16Arrayzh
+ readInt32Arrayzh
+ readInt64Arrayzh
+ readWord8Arrayzh
+ readWord16Arrayzh
+ readWord32Arrayzh
+ readWord64Arrayzh
+
+ writeArrayzh
+ writeCharArrayzh
+ writeWideCharArrayzh
+ writeIntArrayzh
+ writeWordArrayzh
+ writeAddrArrayzh
+ writeFloatArrayzh
+ writeDoubleArrayzh
+ writeStablePtrArrayzh
+ writeInt8Arrayzh
+ writeInt16Arrayzh
+ writeInt32Arrayzh
+ writeInt64Arrayzh
+ writeWord8Arrayzh
+ writeWord16Arrayzh
+ writeWord32Arrayzh
+ writeWord64Arrayzh
+
+ indexCharOffAddrzh
+ indexWideCharOffAddrzh
+ indexIntOffAddrzh
+ indexWordOffAddrzh
+ indexAddrOffAddrzh
+ indexFloatOffAddrzh
+ indexDoubleOffAddrzh
+ indexStablePtrOffAddrzh
+ indexInt8OffAddrzh
+ indexInt16OffAddrzh
+ indexInt32OffAddrzh
+ indexInt64OffAddrzh
+ indexWord8OffAddrzh
+ indexWord16OffAddrzh
+ indexWord32OffAddrzh
+ indexWord64OffAddrzh
+
+ readCharOffAddrzh
+ readWideCharOffAddrzh
+ readIntOffAddrzh
+ readWordOffAddrzh
+ readAddrOffAddrzh
+ readFloatOffAddrzh
+ readDoubleOffAddrzh
+ readStablePtrOffAddrzh
+ readInt8OffAddrzh
+ readInt16OffAddrzh
+ readInt32OffAddrzh
+ readInt64OffAddrzh
+ readWord8OffAddrzh
+ readWord16OffAddrzh
+ readWord32OffAddrzh
+ readWord64OffAddrzh
+
+ writeCharOffAddrzh
+ writeWideCharOffAddrzh
+ writeIntOffAddrzh
+ writeWordOffAddrzh
+ writeAddrOffAddrzh
+ writeForeignObjOffAddrzh
+ writeFloatOffAddrzh
+ writeDoubleOffAddrzh
+ writeStablePtrOffAddrzh
+ writeInt8OffAddrzh
+ writeInt16OffAddrzh
+ writeInt32OffAddrzh
+ writeInt64OffAddrzh
+ writeWord8OffAddrzh
+ writeWord16OffAddrzh
+ writeWord32OffAddrzh
+ writeWord64OffAddrzh
+
+ eqForeignObjzh
+ indexCharOffForeignObjzh
+ indexWideCharOffForeignObjzh
+ indexIntOffForeignObjzh
+ indexWordOffForeignObjzh
+ indexAddrOffForeignObjzh
+ indexFloatOffForeignObjzh
+ indexDoubleOffForeignObjzh
+ indexStablePtrOffForeignObjzh
+ indexInt8OffForeignObjzh
+ indexInt16OffForeignObjzh
+ indexInt32OffForeignObjzh
+ indexInt64OffForeignObjzh
+ indexWord8OffForeignObjzh
+ indexWord16OffForeignObjzh
+ indexWord32OffForeignObjzh
+ indexWord64OffForeignObjzh
+
+ unsafeFreezzeArrayzh -- Note zz in the middle
+ unsafeFreezzeByteArrayzh -- Ditto
+
+ unsafeThawArrayzh
+
+ sizzeofByteArrayzh -- Ditto
+ sizzeofMutableByteArrayzh -- Ditto
+
+ MutVarzh
+ newMutVarzh
+ readMutVarzh
+ writeMutVarzh
+ sameMutVarzh
+
+ catchzh
+ raisezh
+
+ Weakzh
+ mkWeakzh
+ deRefWeakzh
+ finalizzeWeakzh
+
+ ForeignObjzh
+ mkForeignObjzh
+ writeForeignObjzh
+ foreignObjToAddrzh
+ touchzh
+
+ StablePtrzh
+ makeStablePtrzh
+ deRefStablePtrzh
+ eqStablePtrzh
+
+ StableNamezh
+ makeStableNamezh
+ eqStableNamezh
+ stableNameToIntzh
+
+ reallyUnsafePtrEqualityzh
+
+ newBCOzh
+ BCOzh
+ mkApUpd0zh
+
+ unsafeCoercezh
+ addrToHValuezh
+;
+
+-- Export PrelErr.error, so that others do not have to import PrelErr
+__export PrelErr error ;
+
+
+--------------------------------------------------
+instance {CCallable Charzh} = zdfCCallableCharzh;
+instance {CCallable Doublezh} = zdfCCallableDoublezh;
+instance {CCallable Floatzh} = zdfCCallableFloatzh;
+instance {CCallable Intzh} = zdfCCallableIntzh;
+instance {CCallable Addrzh} = zdfCCallableAddrzh;
+instance {CCallable Int64zh} = zdfCCallableInt64zh;
+instance {CCallable Word64zh} = zdfCCallableWord64zh;
+instance {CCallable Wordzh} = zdfCCallableWordzh;
+instance {CCallable ByteArrayzh} = zdfCCallableByteArrayzh;
+instance __forall s => {CCallable (MutableByteArrayzh s)} = zdfCCallableMutableByteArrayzh;
+instance {CCallable ForeignObjzh} = zdfCCallableForeignObjzh;
+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 ;
+
+-- These guys do not really exist:
+--
+1 zdfCCallableCharzh :: {CCallable Charzh} ;
+1 zdfCCallableDoublezh :: {CCallable Doublezh} ;
+1 zdfCCallableFloatzh :: {CCallable Floatzh} ;
+1 zdfCCallableIntzh :: {CCallable Intzh} ;
+1 zdfCCallableAddrzh :: {CCallable Addrzh} ;
+1 zdfCCallableInt64zh :: {CCallable Int64zh} ;
+1 zdfCCallableWord64zh :: {CCallable Word64zh} ;
+1 zdfCCallableWordzh :: {CCallable Wordzh} ;
+1 zdfCCallableByteArrayzh :: {CCallable ByteArrayzh} ;
+1 zdfCCallableMutableByteArrayzh :: __forall s => {CCallable (MutableByteArrayzh s)} ;
+1 zdfCCallableForeignObjzh :: {CCallable ForeignObjzh} ;
+1 zdfCCallableStablePtrzh :: __forall a => {CCallable (StablePtrzh a)} ;