Commit b437dc06 authored by dnt's avatar dnt
Browse files

[project @ 1997-01-06 17:23:41 by dnt]

The contents of these files are now spread amongst lib/ghc and lib/required
parent 8fe90ccb
This diff is collapsed.
{- The GHCerr module defines the code for the
wired-in error functions, which have a special
type in the compiler (with "open tyvars").
We cannot define these functions in a module where they might be
used (e.g., GHCbase), because the magical wired-in type will get
confused with what the typechecker figures out.
-}
module GHCerr where
import GHCbase (error__)
---------------------------------------------------------------
-- HACK: Magic unfoldings not implemented for unboxed lists
-- Need to define a "build" to avoid undefined symbol
-- in this module to avoid .hi proliferation.
build = error "GHCbase.build"
augment = error "GHCbase.augment"
--{-# GENERATE_SPECS build a #-}
--build :: ((a -> [a] -> [a]) -> [a] -> [a]) -> [a]
--build g = g (:) []
---------------------------------------------------------------
cannon_fodder_to_avoid_empty__versions__ = (1::Int)
-- Used for compiler-generated error message;
-- encoding saves bytes of string junk.
absentErr, parError :: a
irrefutPatError
, noDefaultMethodError
, noExplicitMethodError
, nonExhaustiveGuardsError
, patError
, recConError
, recUpdError :: String -> a
absentErr = error "Oops! The program has entered an `absent' argument!\n"
parError = error "Oops! Entered GHCbase.parError (a GHC bug -- please report it!)\n"
noDefaultMethodError s = error ("noDefaultMethodError:"++s)
noExplicitMethodError s = error ("noExplicitMethodError:"++s)
irrefutPatError s = patError__ (untangle s "irrefutable pattern")
nonExhaustiveGuardsError s = patError__ (untangle s "non-exhaustive guards")
patError s = patError__ (untangle s "pattern-matching")
patError__ = error__ (\ x -> _ccall_ PatErrorHdrHook x)
recConError s = error (untangle s "record constructor")
recUpdError s = error (untangle s "record update")
untangle coded in_str
= "In " ++ in_str
++ (if null msg then "" else (": " ++ msg))
++ "; at " ++ file
++ ", line " ++ line
++ "\n"
where
(file,line,msg)
= case (span not_bar coded) of { (f, (_:rest)) ->
case (span not_bar rest) of { (l, (_:m)) ->
(f,l,m) }}
not_bar c = c /= '|'
This diff is collapsed.
-- This is the mainPrimIO that must be used for Haskell~1.3.
module GHCmain ( mainPrimIO ) where
import qualified Main -- for type of "Main.main"
import GHCbase
mainPrimIO :: PrimIO ()
mainPrimIO = ST $ \ s ->
case Main.main of { IO (ST main_guts) ->
case main_guts s of { (result, s2@(S# _)) ->
case result of
Right () -> ( (), s2 )
Left err -> error ("I/O error: "++showsPrec 0 err "\n")
}}
{-
OLD COMMENT:
Nota Bene! @mainIO@ is written as an explicit function, rather than
by saying: @mainIO = requestToIO main@ so that the code generator
recognises @mainIO@ as a {\em function} (hence HNF, hence not
updatable), rather than a zero-arity CAF (hence updatable). If it is
updated, then we have a mega-space leak, because the entire action
(@requestToIO main@) is retained indefinitely.
(This doesn't waste work because @mainIO@ is only used once.)
-}
This diff is collapsed.
interface Main 1
__exports__
Main main (..)
__declarations__
Main.main :: GHCbase.IO Prelude.();
interface Main 1
__exports__
Main main (..)
__declarations__
Main.main :: GHCbase.IO Prelude.();
interface Main 1
__exports__
Main main (..)
__declarations__
Main.main :: GHCbase.IO Prelude.();
interface Main 1
__exports__
Main main (..)
__declarations__
Main.main :: GHCbase.IO Prelude.();
This diff is collapsed.
-- solely for backward-compatibility with pre-2.00 GHC systems.
module PreludeGlaST (
Array(..), -- NB: makes internals visible
MutableVar,
ST,
ByteArray,
MutableArray,
MutableByteArray,
PrimIO,
Addr(..), Word(..),
CCallable(..), CReturnable(..),
boundsOfArray,
boundsOfByteArray,
fixPrimIO,
fixST,
forkPrimIO,
forkST,
freezeAddrArray,
freezeArray,
freezeCharArray,
freezeDoubleArray,
freezeFloatArray,
freezeIntArray,
indexAddrArray,
indexAddrOffAddr,
indexCharArray,
indexCharOffAddr,
indexDoubleArray,
indexDoubleOffAddr,
indexFloatArray,
indexFloatOffAddr,
indexIntArray,
indexIntOffAddr,
ioToST,
listPrimIO,
listST,
mapAndUnzipPrimIO,
mapAndUnzipST,
mapPrimIO,
mapST,
newAddrArray,
newArray,
newCharArray,
newDoubleArray,
newFloatArray,
newIntArray,
newVar,
readAddrArray,
readArray,
readCharArray,
readDoubleArray,
readFloatArray,
readIntArray,
readVar,
returnPrimIO,
returnST,
returnStrictlyST,
runST,
primIOToIO,
ioToPrimIO,
sameMutableArray,
sameMutableByteArray,
sameVar,
seqPrimIO,
seqST,
seqStrictlyST,
stToIO,
thawArray,
thenPrimIO,
thenST,
thenStrictlyST,
unsafeFreezeArray,
unsafeFreezeByteArray,
unsafeInterleavePrimIO,
unsafeInterleaveST,
unsafePerformPrimIO,
writeAddrArray,
writeArray,
writeCharArray,
writeDoubleArray,
writeFloatArray,
writeIntArray,
writeVar
#ifndef __PARALLEL_HASKELL__
, makeStablePtr
, deRefStablePtr
, freeStablePtr
, performGC
#endif
) where
import GHCbase
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment