News for hackers. Stuff that matters.
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.