3 double, compute1, compute2
7 {- Preliminaries ... -}
9 {- patError# { Int# } (built into compiler) -}
11 local_map f (x:xs) = (f x) : local_map f xs
16 instance Eq Int# where
20 instance Read Int# where
21 readsPrec p s = map (\ (I# i#, s) -> (i#, s)) (readsPrec p s)
22 readList s = map (\ (x, s) -> (local_map (\ (I# i#) -> i#) x, s)) (readList s)
24 instance Show Int# where
25 showsPrec p x = showsPrec p (I# x)
26 showList l = showList (local_map I# l)
28 instance Num Int# where
29 (+) x y = plusInt# x y
30 (-) x y = minusInt# x y
31 negate x = negateInt# x
32 (*) x y = timesInt# x y
33 abs n = if n `geInt#` 0# then n else (negateInt# n)
35 signum n | n `ltInt#` 0# = negateInt# 1#
39 fromInteger (J# a# s# d#)
40 = integer2Int# a# s# d#
44 double x = x * x + x * x - x * x + x * x - x * x
46 compute1 n = 1# + double n
47 compute2 n = (1::Int) + double n