integerPlusOneIdKey,
integerPlusTwoIdKey,
int2IntegerIdKey,
- addr2IntegerIdKey,
integerTyConKey,
integerZeroIdKey,
integralClassKey,
integerPlusTwoIdKey = mkPreludeMiscIdUnique 11
integerZeroIdKey = mkPreludeMiscIdUnique 12
int2IntegerIdKey = mkPreludeMiscIdUnique 13
-addr2IntegerIdKey = mkPreludeMiscIdUnique 14
irrefutPatErrorIdKey = mkPreludeMiscIdUnique 15
eqStringIdKey = mkPreludeMiscIdUnique 16
noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 17
, (makeStablePtr_RDR, makeStablePtrIdKey)
, (bindIO_RDR, bindIOIdKey)
, (returnIO_RDR, returnIOIdKey)
- , (addr2Integer_RDR, addr2IntegerIdKey)
-- Strings and lists
, (map_RDR, mapIdKey)
error_RDR, assertErr_RDR,
showString_RDR, showParen_RDR, readParen_RDR, lex_RDR,
showSpace_RDR, showList___RDR, readList___RDR, negate_RDR,
- addr2Integer_RDR, ioTyCon_RDR,
- foldr_RDR, build_RDR, getTag_RDR, plusInteger_RDR, timesInteger_RDR, eqString_RDR,
+ ioTyCon_RDR, foldr_RDR, build_RDR, getTag_RDR, plusInteger_RDR, timesInteger_RDR, eqString_RDR,
orderingTyCon_RDR, rationalTyCon_RDR, ratioTyCon_RDR, byteArrayTyCon_RDR,
mutableByteArrayTyCon_RDR, foreignObjTyCon_RDR,
negate_RDR = varQual pREL_NUM_Name SLIT("negate")
plus_RDR = varQual pREL_NUM_Name SLIT("+")
times_RDR = varQual pREL_NUM_Name SLIT("*")
-addr2Integer_RDR = varQual pREL_NUM_Name SLIT("addr2Integer")
plusInteger_RDR = varQual pREL_NUM_Name SLIT("plusInteger")
timesInteger_RDR = varQual pREL_NUM_Name SLIT("timesInteger")
-----------------------------------------------------------------------
--- $Id: primops.txt,v 1.4 2000/09/11 12:20:57 sewardj Exp $
+-- $Id: primops.txt,v 1.5 2000/09/26 16:45:34 simonpj Exp $
--
-- Primitive Operations
--
primop Addr2IntOp "addr2Int#" GenPrimOp Addr# -> Int#
-primop Addr2IntegerOp "addr2Integer#" GenPrimOp
- Addr# -> (# Int#, ByteArr# #)
- with out_of_line = True
-
------------------------------------------------------------------------
--- Char# ---
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.62 2000/09/11 11:17:09 sewardj Exp $
+ * $Id: PrimOps.h,v 1.63 2000/09/26 16:45:34 simonpj Exp $
*
* (c) The GHC Team, 1998-1999
*
/* Conversions */
EXTFUN_RTS(int2Integerzh_fast);
EXTFUN_RTS(word2Integerzh_fast);
-EXTFUN_RTS(addr2Integerzh_fast);
/* Floating-point decodings */
EXTFUN_RTS(decodeFloatzh_fast);
% -----------------------------------------------------------------------------
-% $Id: PrelBase.lhs,v 1.37 2000/09/07 09:10:07 simonpj Exp $
+% $Id: PrelBase.lhs,v 1.38 2000/09/26 16:45:34 simonpj Exp $
%
% (c) The University of Glasgow, 1992-2000
%
(
module PrelBase,
module PrelGHC, -- Re-export PrelGHC, PrelErr & PrelNum, to avoid lots
- module PrelErr, -- of people having to import it explicitly
- module PrelNum
+ module PrelErr -- of people having to import it explicitly
)
where
import PrelGHC
import {-# SOURCE #-} PrelErr
-import {-# SOURCE #-} PrelNum
infixr 9 .
infixr 5 ++, :
class Eq a where
(==), (/=) :: a -> a -> Bool
--- x /= y = not (x == y)
--- x == y = not (x /= y)
--- x /= y = True
- (/=) x y = not ((==) x y)
- x == y = True
+ (/=) x y = not ((==) x y)
+ (==) x y = not ((/=) x y)
class (Eq a) => Ord a where
compare :: a -> a -> Ordering
foldr k z xs = go xs
where
go [] = z
- go (x:xs) = x `k` go xs
+ go (y:ys) = y `k` go ys
build :: forall a. (forall b. (a -> b -> b) -> b -> b) -> [a]
{-# INLINE 2 build #-}
map = mapList
-- Note eta expanded
+mapFB :: (elt -> lst -> lst) -> (a -> elt) -> a -> lst -> lst
mapFB c f x ys = c (f x) ys
mapList :: (a -> b) -> [a] -> [b]
leAddrzh
int2Addrzh
addr2Intzh
- addr2Integerzh
Floatzh
gtFloatzh
% ------------------------------------------------------------------------------
-% $Id: PrelNum.lhs,v 1.33 2000/09/25 12:58:39 simonpj Exp $
+% $Id: PrelNum.lhs,v 1.34 2000/09/26 16:45:34 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
integer2Int (S# i) = I# i
integer2Int (J# s d) = case (integer2Int# s d) of { n# -> I# n# }
-addr2Integer :: Addr# -> Integer
-{-# INLINE addr2Integer #-}
-addr2Integer x = case addr2Integer# x of (# s, d #) -> J# s d
-
toBig (S# i) = case int2Integer# i of { (# s, d #) -> J# s d }
toBig i@(J# _ _) = i
\end{code}
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.54 2000/08/25 13:12:07 simonmar Exp $
+ * $Id: PrimOps.hc,v 1.55 2000/09/26 16:45:35 simonpj Exp $
*
* (c) The GHC Team, 1998-2000
*
FE_
}
-FN_(addr2Integerzh_fast)
-{
- MP_INT result;
- char *str;
- FB_
-
- MAYBE_GC(NO_PTRS,addr2Integerzh_fast);
-
- /* args: R1 :: Addr# */
- str = R1.a;
-
- /* Perform the operation */
- if (RET_STGCALL3(int, mpz_init_set_str,&result,(str),/*base*/10))
- abort();
-
- /* returns (# size :: Int#,
- data :: ByteArray#
- #)
- */
- TICK_RET_UNBOXED_TUP(2);
- RET_NP(result._mp_size,
- result._mp_d - sizeofW(StgArrWords));
- FE_
-}
/*
* 'long long' primops for converting to/from Integers.