News for hackers. Stuff that matters.
Re:Conrad Barski's Haskell Tutorial by lelf on Sunday July 14, 2013 @03:22PM (#6041871)
> In Haskell, this type of integer can't get bigger than 2^31...

It's platform-dependent

  h> finiteBitSize (0 :: Int)
  64
> We could have used the type Integer instead- This type of integer grows "magically" and can hold any sized integer, no matter how big... but it's slower, so we used Int instead, since our numbers will never get that big.

Premature optimisation at its best.

Re:Conrad Barski's Haskell Tutorial by pogden on Sunday July 14, 2013 @04:59PM (#6042216)
In Haskell you can also use the Integral typeclass to make functions polymorphic to Int and Integer.
Re:Conrad Barski's Haskell Tutorial by lelf on Sunday July 14, 2013 @05:09PM (#6042251)
And why would you do this in simple tutorial program? Anyway, you'd need Num.
Re:Conrad Barski's Haskell Tutorial by dfeltey on Sunday July 14, 2013 @07:59PM (#6042828)
I don't know why anyone would use the Integral typeclass over just Int or Integer in a simple program like this, but you wouldn't need Num in addition to Integral, every instance of Integral must also be an instance of Real, and instances of Real must be instances of Num.