Re: [Haskell-cafe] How to convert number types.

Ah, thanks, it is my fault, for mis-understanding the hint from GHC. And what is the difference between fromIntegral and fromInteger ? ------------------ L.Guo 2008-01-01 ------------------------------------------------------------- From: Mark T.B. Carroll At: 2008-01-01 01:42:37 Subject: Re: [Haskell-cafe] How to convert number types. Perhaps fromIntegral does what you want? Mark

On Dec 31, 2007, at 12:50 , L.Guo wrote:
And what is the difference between fromIntegral and fromInteger ?
Integer is a specific single type: unlimited-precision integers. Integral is a typeclass which includes, among others: Integer, Int (integers represented in machine words, so either 32 or 64 bits), the various Word* types defined in Data.Word (various fixed word sizes such as Word8, as distinct from the hardware-preferred one represented by Int), and the compatibility types defined in Foreign.C.Types. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Brandon S. Allbery KF8NH
-
L.Guo