cReturnableClassName, -- mentioned, ccallish
-- ClassOps
- fromIntName,
fromIntegerName,
negateName,
geName,
-- Module PrelNum
numClassName = clsQual pREL_NUM_Name SLIT("Num") numClassKey
-fromIntName = varQual pREL_NUM_Name SLIT("fromInt") fromIntClassOpKey
fromIntegerName = varQual pREL_NUM_Name SLIT("fromInteger") fromIntegerClassOpKey
minusName = varQual pREL_NUM_Name SLIT("-") minusClassOpKey
negateName = varQual pREL_NUM_Name SLIT("negate") negateClassOpKey
during type checking.
\begin{code}
-fromIntClassOpKey = mkPreludeMiscIdUnique 101
fromIntegerClassOpKey = mkPreludeMiscIdUnique 102
minusClassOpKey = mkPreludeMiscIdUnique 103
fromRationalClassOpKey = mkPreludeMiscIdUnique 104
%* *
%************************************************************************
-Haskell 98 says that when you say "3" you get the "fromInt" from the
+Haskell 98 says that when you say "3" you get the "fromInteger" from the
Standard Prelude, regardless of what is in scope. However, to experiment
with having a language that is less coupled to the standard prelude, we're
-trying a non-standard extension that instead gives you whatever "Prelude.fromInt"
+trying a non-standard extension that instead gives you whatever "Prelude.fromInteger"
happens to be in scope. Then you can
import Prelude ()
import MyPrelude as Prelude
-- to a RdrName for the re-mapped version of the built-in thing
syntaxList :: SyntaxList
-syntaxList =[ (fromIntName, mkUnqual varName SLIT("fromInt"))
- , (fromIntegerName, mkUnqual varName SLIT("fromInteger"))
+syntaxList =[ (fromIntegerName, mkUnqual varName SLIT("fromInteger"))
, (fromRationalName, mkUnqual varName SLIT("fromRational"))
, (negateName, mkUnqual varName SLIT("negate"))
, (minusName, mkUnqual varName SLIT("-"))
type SyntaxMap = Name -> Name
- -- Maps a standard built-in name, such as PrelNum.fromInt
- -- to its re-mapped version, such as MyPrelude.fromInt
+ -- Maps a standard built-in name, such as PrelNum.fromInteger
+ -- to its re-mapped version, such as MyPrelude.fromInteger
vanillaSyntaxMap name = name
\end{code}
import OccName ( OccName, occNameUserString, occNameFlavour )
import Module ( ModuleName, moduleName, mkVanillaModule,
mkSysModuleNameFS, moduleNameFS, WhereFrom(..) )
-import TysWiredIn ( unitTyCon, intTyCon, boolTyCon, integerTyCon )
-import Type ( funTyCon )
import PrelNames ( mkUnboundName, syntaxList, SyntaxMap, vanillaSyntaxMap,
derivingOccurrences,
mAIN_Name, pREL_MAIN_Name,
- ioTyConName, printName,
+ ioTyConName, integerTyConName, doubleTyConName, intTyConName,
+ boolTyConName, funTyConName,
unpackCStringName, unpackCStringFoldrName, unpackCStringUtf8Name,
- eqStringName
+ eqStringName, printName,
+ hasKey, fractionalClassKey, numClassKey
)
+import TysWiredIn ( unitTyCon ) -- A little odd
import FiniteMap
import UniqSupply
import SrcLoc ( SrcLoc, noSrcLoc )
-- Virtually every program has error messages in it somewhere
`plusFV`
- mkFVs (map getName [unitTyCon, funTyCon, boolTyCon, intTyCon, integerTyCon])
- -- Add occurrences for Integer, and (), because they
- -- are the types to which ambigious type variables may be defaulted by
- -- the type checker; so they won't always appear explicitly.
- -- [The () one is a GHC extension for defaulting CCall results.]
- -- ALSO: funTyCon, since it occurs implicitly everywhere!
- -- (we don't want to be bothered with making funTyCon a
+ mkFVs [getName unitTyCon, funTyConName, boolTyConName, intTyConName]
+ -- Add occurrences for very frequently used types.
+ -- (e.g. we don't want to be bothered with making funTyCon a
-- free var at every function application!)
- -- Double is dealt with separately in getGates
+\end{code}
+
+\begin{code}
+implicitGates :: Name -> FreeVars
+-- If we load class Num, add Integer to the gates
+-- This takes account of the fact that Integer might be needed for
+-- defaulting, but we don't want to load Integer (and all its baggage)
+-- if there's no numeric stuff needed.
+-- Similarly for class Fractional and Double
+--
+-- NB: If we load (say) Floating, we'll end up loading Fractional too,
+-- since Fractional is a superclass of Floating
+implicitGates cls | cls `hasKey` numClassKey = unitFV integerTyConName
+ | cls `hasKey` fractionalClassKey = unitFV doubleTyConName
+ | otherwise = emptyFVs
\end{code}
\begin{code}
import CmdLineOpts ( DynFlag(..), opt_IgnoreAsserts )
import Literal ( inIntRange )
import BasicTypes ( Fixity(..), FixityDirection(..), defaultFixity, negateFixity )
-import PrelNames ( hasKey, assertIdKey, minusName, negateName, fromIntName,
+import PrelNames ( hasKey, assertIdKey, minusName, negateName, fromIntegerName,
eqClass_RDR, foldr_RDR, build_RDR, eqString_RDR,
cCallableClass_RDR, cReturnableClass_RDR,
monadClass_RDR, enumClass_RDR, ordClass_RDR,
rnOverLit (HsIntegral i)
| inIntRange i
- = returnRn (HsIntegral i, unitFV fromIntName)
+ = returnRn (HsIntegral i, unitFV fromIntegerName)
| otherwise
= lookupOrigNames [fromInteger_RDR, plusInteger_RDR, timesInteger_RDR] `thenRn` \ ns ->
-- Big integers are built, using + and *, out of small integers
+ -- [No particular reason why we use fromIntegerName in one case can
+ -- fromInteger_RDR in the other; but plusInteger_RDR means we
+ -- can get away without plusIntegerName altogether.]
returnRn (HsIntegral i, ns)
rnOverLit (HsFractional i)
import Type ( namesOfType )
import TyCon ( isSynTyCon, getSynTyConDefn )
import Name ( Name {-instance NamedThing-}, nameOccName,
- nameModule, isLocalName, nameUnique,
+ nameModule, isLocalName,
NamedThing(..)
)
import Name ( elemNameEnv, delFromNameEnv )
elemModuleSet, extendModuleSet
)
import NameSet
-import PrelInfo ( wiredInThingEnv, fractionalClassKeys )
-import TysWiredIn ( doubleTyCon )
+import PrelInfo ( wiredInThingEnv )
import Maybes ( orElse )
import FiniteMap
import Outputable
= (delListFromNameSet (foldr (plusFV . get) (extractHsCtxtTyNames ctxt) sigs)
(hsTyVarNames tvs)
`addOneToNameSet` cls)
- `plusFV` maybe_double
+ `plusFV` implicitGates cls
where
get (ClassOpSig n _ ty _)
| is_used n = extractHsTyNames ty
| otherwise = emptyFVs
- -- If we load any numeric class that doesn't have
- -- Int as an instance, add Double to the gates.
- -- This takes account of the fact that Double might be needed for
- -- defaulting, but we don't want to load Double (and all its baggage)
- -- if the more exotic classes aren't used at all.
- maybe_double | nameUnique cls `elem` fractionalClassKeys
- = unitFV (getName doubleTyCon)
- | otherwise
- = emptyFVs
-
get_gates is_used (TySynonym {tcdTyVars = tvs, tcdSynRhs = ty})
= delListFromNameSet (extractHsTyNames ty) (hsTyVarNames tvs)
-- A type synonym type constructor isn't a "gate" for instance decls
doubleDataCon, isDoubleTy,
isIntegerTy
)
-import PrelNames( fromIntName, fromIntegerName, fromRationalName )
+import PrelNames( fromIntegerName, fromRationalName )
import Util ( thenCmp, zipWithEqual, mapAccumL )
import Bag
import Outputable
| isIntegerTy ty -- Short cut for Integer
= returnNF_Tc (GenInst [] integer_lit)
- | in_int_range -- It's overloaded but small enough to fit into an Int
- = -- So we can use the Prelude fromInt
- tcLookupSyntaxId fromIntName `thenNF_Tc` \ from_int ->
- newMethodAtLoc loc from_int [ty] `thenNF_Tc` \ (method_inst, method_id) ->
- returnNF_Tc (GenInst [method_inst] (HsApp (HsVar method_id) int_lit))
-
| otherwise -- Alas, it is overloaded and a big literal!
= tcLookupSyntaxId fromIntegerName `thenNF_Tc` \ from_integer ->
newMethodAtLoc loc from_integer [ty] `thenNF_Tc` \ (method_inst, method_id) ->
tcLookupSyntaxId :: Name -> NF_TcM Id
-- Lookup a name like PrelNum.fromInt, and return the corresponding Id,
-- after mapping through the SyntaxMap. This may give us the Id for
--- (say) MyPrelude.fromInt
+-- (say) MyPrelude.fromInteger
tcLookupSyntaxId name
= tcGetEnv `thenNF_Tc` \ env ->
returnNF_Tc (case lookup_global env (tcSyntaxMap env name) of
-- Value declarations next.
-- We also typecheck any extra binds that came out of the "deriving" process
+ traceTc (text "Default types" <+> ppr defaulting_tys) `thenNF_Tc_`
traceTc (text "Tc5") `thenNF_Tc_`
tcTopBinds (val_binds `ThenBinds` deriv_binds) `thenTc` \ ((val_binds, env), lie_valdecls) ->
% -----------------------------------------------------------------------------
-% $Id: CPUTime.lhs,v 1.27 2001/01/11 17:25:57 simonmar Exp $
+% $Id: CPUTime.lhs,v 1.28 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The University of Glasgow, 1995-2000
%
cpuTimePrecision :: Integer
cpuTimePrecision = round ((1000000000000::Integer) %
- fromInt (unsafePerformIO clockTicks))
+ fromIntegral (unsafePerformIO clockTicks))
foreign import "libHS_cbits" "getCPUTime" unsafe primGetCPUTime :: ByteArray Int -> IO Int
foreign import "libHS_cbits" "clockTicks" unsafe clockTicks :: IO Int
% -----------------------------------------------------------------------------
-% $Id: Numeric.lhs,v 1.10 2000/12/16 17:46:57 qrczak Exp $
+% $Id: Numeric.lhs,v 1.11 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The University of Glasgow, 1997-2000
%
(p - 1 + e0) * 3 `div` 10
else
ceiling ((log (fromInteger (f+1)) +
- fromInt e * log (fromInteger b)) /
+ fromIntegral e * log (fromInteger b)) /
log (fromInteger base))
fixup n =
if n >= 0 then
% -----------------------------------------------------------------------------
-% $Id: PrelByteArr.lhs,v 1.11 2001/02/20 18:40:54 qrczak Exp $
+% $Id: PrelByteArr.lhs,v 1.12 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
module PrelByteArr where
import {-# SOURCE #-} PrelErr ( error )
+import PrelNum
import PrelArr
import PrelFloat
import PrelST
% -----------------------------------------------------------------------------
-% $Id: PrelCTypes.lhs,v 1.1 2001/01/11 17:25:57 simonmar Exp $
+% $Id: PrelCTypes.lhs,v 1.2 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The FFI task force, 2000
%
\begin{code}
import PrelBase ( unsafeCoerce# )
import PrelReal ( Integral(toInt) )
-import PrelNum ( Num(fromInt) )
import PrelBits ( Bits(..) )
import PrelInt ( Int8, Int16, Int32, Int64 )
import PrelWord ( Word8, Word16, Word32, Word64 )
% -----------------------------------------------------------------------------
-% $Id: PrelCTypesISO.lhs,v 1.3 2001/01/12 17:38:27 simonmar Exp $
+% $Id: PrelCTypesISO.lhs,v 1.4 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The FFI task force, 2000
%
import PrelBase ( unsafeCoerce# )
import PrelReal ( Integral(toInt) )
import PrelBits ( Bits(..) )
-import PrelNum ( Num(fromInt) )
import PrelInt ( Int8, Int16, Int32, Int64 )
import PrelWord ( Word8, Word16, Word32, Word64 )
\end{code}
% ------------------------------------------------------------------------------
-% $Id: PrelFloat.lhs,v 1.9 2000/08/29 16:37:35 simonpj Exp $
+% $Id: PrelFloat.lhs,v 1.10 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
-- fromInteger in turn inlines,
-- so that if fromInteger is applied to an (S# i) the right thing happens
- {-# INLINE fromInt #-}
- fromInt i = int2Float i
-
instance Real Float where
toRational x = (m%1)*(b%1)^^n
where (m,n) = decodeFloat x
{-# INLINE fromInteger #-}
-- See comments with Num Float
- fromInteger n = encodeFloat n 0
- fromInt (I# n#) = case (int2Double# n#) of { d# -> D# d# }
+ fromInteger (S# i#) = case (int2Double# i#) of { d# -> D# d# }
+ fromInteger (J# s# d#) = encodeDouble# s# d# 0
+
instance Real Double where
toRational x = (m%1)*(b%1)^^n
instance Enum Float where
succ x = x + 1
pred x = x - 1
- toEnum = fromInt
- fromEnum = fromInteger . truncate -- may overflow
- enumFrom = numericEnumFrom
- enumFromTo = numericEnumFromTo
- enumFromThen = numericEnumFromThen
- enumFromThenTo = numericEnumFromThenTo
+ toEnum = int2Float
+ fromEnum = fromInteger . truncate -- may overflow
+ enumFrom = numericEnumFrom
+ enumFromTo = numericEnumFromTo
+ enumFromThen = numericEnumFromThen
+ enumFromThenTo = numericEnumFromThenTo
instance Enum Double where
succ x = x + 1
pred x = x - 1
- toEnum = fromInt
+ toEnum = int2Double
fromEnum = fromInteger . truncate -- may overflow
enumFrom = numericEnumFrom
enumFromTo = numericEnumFromTo
(p - 1 + e0) * 3 `div` 10
else
ceiling ((log (fromInteger (f+1)) +
- fromInt e * log (fromInteger b)) /
+ fromInteger (int2Integer e) * log (fromInteger b)) /
log (fromInteger base))
--WAS: fromInt e * log (fromInteger b))
% ------------------------------------------------------------------------------
-% $Id: PrelHandle.lhs,v 1.66 2001/01/11 17:25:57 simonmar Exp $
+% $Id: PrelHandle.lhs,v 1.67 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The AQUA Project, Glasgow University, 1994-2000
%
import PrelMaybe ( Maybe(..) )
import PrelException
import PrelEnum
-import PrelNum ( toBig, Integer(..), Num(..) )
+import PrelNum ( toBig, Integer(..), Num(..), int2Integer )
import PrelShow
import PrelReal ( toInteger )
import PrelPack ( packString )
wantSeekableHandle "hGetPosn" handle $ \ handle_ -> do
posn <- getFilePosn (haFO__ handle_) -- ConcHask: SAFE, won't block
if posn /= -1 then do
- return (mkHandlePosn handle (fromInt posn))
+ return (mkHandlePosn handle (int2Integer posn))
else
constructErrorAndFail "hGetPosn"
% ------------------------------------------------------------------------------
-% $Id: PrelIOBase.lhs,v 1.34 2001/02/20 18:40:54 qrczak Exp $
+% $Id: PrelIOBase.lhs,v 1.35 2001/02/22 13:17:58 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
import PrelST
import PrelBase
-import PrelNum ( fromInt ) -- Integer literals
+import PrelNum -- To get fromInteger etc, needed because of -fno-implicit-prelude
import PrelMaybe ( Maybe(..) )
import PrelShow
import PrelList
#ifdef __HUGS__
/* Hugs doesn't distinguish these types so no coercion required) */
#else
+-- stToIO :: (forall s. ST s a) -> IO a
stToIO :: ST RealWorld a -> IO a
-stToIO (ST m) = (IO m)
+stToIO (ST m) = IO m
ioToST :: IO a -> ST RealWorld a
ioToST (IO m) = (ST m)
unsafePerformIO :: IO a -> a
unsafePerformIO (IO m) = case m realWorld# of (# _, r #) -> r
+{-# NOINLINE unsafeInterleaveIO #-}
unsafeInterleaveIO :: IO a -> IO a
-unsafeInterleaveIO = stToIO . unsafeInterleaveST . ioToST
+unsafeInterleaveIO (IO m)
+ = IO ( \ s -> let
+ r = case m s of (# _, res #) -> res
+ in
+ (# s, r #))
#endif
\end{code}
signum = signumReal
fromInteger (S# i#) = I8# (intToInt8# i#)
fromInteger (J# s# d#) = I8# (intToInt8# (integer2Int# s# d#))
- fromInt = intToInt8
instance Bounded Int8 where
minBound = 0x80
signum = signumReal
fromInteger (S# i#) = I16# (intToInt16# i#)
fromInteger (J# s# d#) = I16# (intToInt16# (integer2Int# s# d#))
- fromInt = intToInt16
instance Bounded Int16 where
minBound = 0x8000
signum = signumReal
fromInteger (S# i#) = I32# (intToInt32# i#)
fromInteger (J# s# d#) = I32# (intToInt32# (integer2Int# s# d#))
- fromInt = intToInt32
instance Bounded Int32 where
- minBound = fromInt minBound
- maxBound = fromInt maxBound
+ minBound = int2Int32 minBound
+ maxBound = int2Int32 maxBound
+
+int2Int32 :: Int -> Int32
+int2Int32 (I# i#) = I32# (intToInt32# i#)
instance Real Int32 where
toRational x = toInteger x % 1
signum = signumReal
fromInteger (S# i#) = I64# i#
fromInteger (J# s# d#) = I64# (integer2Int# s# d#)
- fromInt = intToInt64
instance Bounded Int64 where
minBound = integerToInt64 (-0x8000000000000000)
abs x = absReal x
signum = signumReal
fromInteger i = integerToInt64 i
- fromInt i = intToInt64 i
compareInt64# :: Int64# -> Int64# -> Ordering
compareInt64# i# j#
% ------------------------------------------------------------------------------
-% $Id: PrelNum.lhs,v 1.34 2000/09/26 16:45:34 simonpj Exp $
+% $Id: PrelNum.lhs,v 1.35 2001/02/22 13:17:59 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
negate :: a -> a
abs, signum :: a -> a
fromInteger :: Integer -> a
- fromInt :: Int -> a -- partain: Glasgow extension
x - y = x + negate y
negate x = 0 - x
- fromInt (I# i#) = fromInteger (S# i#)
- -- Go via the standard class-op if the
- -- non-standard one ain't provided
+
+fromInt :: Num a => Int -> a
+-- For backward compatibility
+fromInt (I# i#) = fromInteger (S# i#)
\end{code}
A few small numeric functions
| otherwise = 1
fromInteger n = integer2Int n
- fromInt n = n
\end{code}
(*) = timesInteger
negate = negateInteger
fromInteger x = x
- fromInt (I# i) = S# i
-- ORIG: abs n = if n >= 0 then n else -n
abs (S# (-2147483648#)) = 2147483648
% ------------------------------------------------------------------------------
-% $Id: PrelRead.lhs,v 1.16 2000/08/07 23:37:23 qrczak Exp $
+% $Id: PrelRead.lhs,v 1.17 2001/02/22 13:17:59 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
readInt :: (Integral a) => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
readInt radix isDig digToInt s = do
(ds,r) <- nonnull isDig s
- return (foldl1 (\n d -> n * radix + d) (map (fromInt . digToInt) ds), r)
+ return (foldl1 (\n d -> n * radix + d) (map (fromInteger . int2Integer . digToInt) ds), r)
{-# SPECIALISE readSigned ::
ReadS Int -> ReadS Int,
% ------------------------------------------------------------------------------
-% $Id: PrelReal.lhs,v 1.7 2000/12/16 17:46:57 qrczak Exp $
+% $Id: PrelReal.lhs,v 1.8 2001/02/22 13:17:59 simonpj Exp $
%
% (c) The University of Glasgow, 1994-2000
%
succ x = x + 1
pred x = x - 1
- toEnum n = fromInt n :% 1
+ toEnum n = fromInteger (int2Integer n) :% 1
fromEnum = fromInteger . truncate
enumFrom = numericEnumFrom
% ------------------------------------------------------------------------------
-% $Id: PrelST.lhs,v 1.18 2001/02/20 18:40:54 qrczak Exp $
+% $Id: PrelST.lhs,v 1.19 2001/02/22 13:17:59 simonpj Exp $
%
% (c) The University of Glasgow, 1992-2000
%
module PrelST where
-import PrelNum ( fromInt ) -- For integer literals
+import PrelNum -- To get fromInt etc, needed because of -fno-implicit-prelude
import PrelShow
import PrelBase
import PrelNum () -- So that we get the .hi file for system imports
signum = signumReal
fromInteger (S# i#) = W8# (wordToWord8# (int2Word# i#))
fromInteger (J# s# d#) = W8# (wordToWord8# (integer2Word# s# d#))
- fromInt = intToWord8
instance Bounded Word8 where
minBound = 0
signum = signumReal
fromInteger (S# i#) = W16# (wordToWord16# (int2Word# i#))
fromInteger (J# s# d#) = W16# (wordToWord16# (integer2Word# s# d#))
- fromInt = intToWord16
instance Bounded Word16 where
minBound = 0
signum = signumReal
fromInteger (S# i#) = W32# (intToWord32# i#)
fromInteger (J# s# d#) = W32# (wordToWord32# (integer2Word# s# d#))
- fromInt (I# x) = W32# (intToWord32# x)
-- ToDo: restrict fromInt{eger} range.
intToWord32# :: Int# -> Word#
signum = signumReal
fromInteger (S# i#) = W64# (int2Word# i#)
fromInteger (J# s# d#) = W64# (integer2Word# s# d#)
- fromInt = intToWord64
-- Note: no need to mask results here
-- as they cannot overflow.
abs x = x
signum = signumReal
fromInteger i = integerToWord64 i
- fromInt = intToWord64
-- Note: no need to mask results here as they cannot overflow.
-- ToDo: protect against div by zero.
% ------------------------------------------------------------------------------
-% $Id: Prelude.lhs,v 1.22 2000/06/30 13:39:36 simonmar Exp $
+% $Id: Prelude.lhs,v 1.23 2001/02/22 13:17:59 simonpj Exp $
%
% (c) The University of Glasgow, 1992-2000
%
Enum(..),
Bounded(..),
Num((+), (-), (*), negate, abs, signum, fromInteger),
- -- The fromInt method is exposed only by GlaExts
Real(..),
Integral(quot, rem, div, mod, quotRem, divMod, toInteger),
-- The toInt method is exposed only by GlaExts
% ------------------------------------------------------------------------------
-% $Id: Random.lhs,v 1.21 2000/06/30 13:39:36 simonmar Exp $
+% $Id: Random.lhs,v 1.22 2001/02/22 13:17:59 simonpj Exp $
%
% (c) The University of Glasgow, 1995-2000
%
#ifndef __HUGS__
import PrelGHC ( RealWorld )
-import PrelNum ( fromInt )
import PrelShow ( showSignedInt, showSpace )
import PrelRead ( readDec )
import PrelIOBase ( unsafePerformIO, stToIO )
let
(x,g') = next g
in
- f (n-1) (fromInt x + acc * b) g'
+ f (n-1) (fromIntegral x + acc * b) g'
randomIvalDouble :: (RandomGen g, Fractional a) => (Double, Double) -> (Double -> a) -> g -> (a, g)
randomIvalDouble (l,h) fromDouble rng
/* -----------------------------------------------------------------------------
- * $Id: CTypes.h,v 1.2 2001/02/05 11:49:20 chak Exp $
+ * $Id: CTypes.h,v 1.3 2001/02/22 13:17:59 simonpj Exp $
*
* Dirty CPP hackery for CTypes/CTypesISO
*
negate = unsafeCoerce# (negate :: B -> B); \
abs = unsafeCoerce# (abs :: B -> B); \
signum = unsafeCoerce# (signum :: B -> B); \
- fromInteger = unsafeCoerce# (fromInteger :: Integer -> B); \
- fromInt = unsafeCoerce# (fromInt :: Int -> B) }
+ fromInteger = unsafeCoerce# (fromInteger :: Integer -> B); }
#define INSTANCE_BOUNDED(T,B) \
instance Bounded T where { \