Re: [Haskell-cafe] Int vs Integer

2005-12-19 Thread Benjamin Franksen
On Monday 19 December 2005 11:26, Wolfgang Jeltsch wrote: > Am Montag, 19. Dezember 2005 01:10 schrieb Jared Updike: > > Int is for bounded values -2**32 to 2**32 (I think... maybe 2**-31 > > and 2**31 or less if it's boxed?) based on the underlying machine > > representation. > > Not really true.

Re: [Haskell-cafe] Int vs Integer

2005-12-19 Thread Wolfgang Jeltsch
Am Montag, 19. Dezember 2005 01:10 schrieb Jared Updike: > Int is for bounded values -2**32 to 2**32 (I think... maybe 2**-31 and > 2**31 or less if it's boxed?) based on the underlying machine > representation. Not really true. As far as I remember, the Haskell Report just says that Int covers

Re: [Haskell-cafe] Int vs Integer

2005-12-18 Thread Daniel Carrera
Thanks for the info, and the link. I probably should have guessed the Double vs Float one. I did program in C a while ago... Cheers, Daniel. Jared Updike wrote: Int is for bounded values -2**32 to 2**32 (I think... maybe 2**-31 and 2**31 or less if it's boxed?) based on the underlying machin

Re: [Haskell-cafe] Int vs Integer

2005-12-18 Thread Jared Updike
Int is for bounded values -2**32 to 2**32 (I think... maybe 2**-31 and 2**31 or less if it's boxed?) based on the underlying machine representation. Integer is unbounded (arbitrary precision, i.e. 7489571948579148758174534 is a valid Integer). Double is for floating point values corresponding to C

Re: [Haskell-cafe] Int vs Integer

2005-12-18 Thread Chris Kuklewicz
Daniel Carrera wrote: > Hello all, > > I found a good Haskell tutorial (second link on the Tutorials column) > (now that I know how to run the programs in it). I have a question. > What's the difference between the types Int and Integer? Likewise, > what's the difference between the types Float and

[Haskell-cafe] Int vs Integer

2005-12-18 Thread Daniel Carrera
Hello all, I found a good Haskell tutorial (second link on the Tutorials column) (now that I know how to run the programs in it). I have a question. What's the difference between the types Int and Integer? Likewise, what's the difference between the types Float and Double? Are those just syno

Re: [Haskell-cafe] Int vs Integer?

2005-05-05 Thread Daniel Carrera
Cale Gibbard wrote: Int is the type of machine integers, with guaranteed range at least -2^29 to 2^29 - 1, while Integer is arbitrary precision integers, with range as large as you have memory for. Alright, that was my guess (though I had no idea which was which). I expect you'll replace ints with

Re: [Haskell-cafe] Int vs Integer?

2005-05-05 Thread Cale Gibbard
Int is the type of machine integers, with guaranteed range at least -2^29 to 2^29 - 1, while Integer is arbitrary precision integers, with range as large as you have memory for. The code you gave, on its own, is fine. The types inferred by ghci are ints :: [Int] and prng :: [[Int]] Hugs seems to

[Haskell-cafe] Int vs Integer?

2005-05-05 Thread Daniel Carrera
Hello, What's the difference between "Int" and "Integer"? How can I tell Haskell which one I want? I'm having trouble with a function: ints = 0 : map (1+) ints prng = map iter ints where iter 0 = [0,0] iter n = [i,j] where i = mod n 256 j = ints