News for hackers. Stuff that matters.
Re:Advanced programming languages by jmillikin on Monday May 24, 2010 @07:16PM (#1375927)
Which is, when you think about it, not a good idea. If 'sprintf' is defined, then 'printf' ought to be simply 'putStr . sprintf'.
Re:Advanced programming languages by chc on Monday May 24, 2010 @08:04PM (#1376044)
But sprintf is not defined in Haskell, nor is it really needed. printf returns a typeclass that includes both 'String' and 'IO a'.
Re:Advanced programming languages by jmillikin on Monday May 24, 2010 @08:31PM (#1376086)
My point is that there should be no typeclass; there's no reason to combine IO and formatting in the same function, and doing so makes it more difficult to read and modify code.
Re:Advanced programming languages by loewenskind on Tuesday May 25, 2010 @04:26AM (#1376837)
Agreed. This is something I dislike about Haskell. After seeing the regex class and it tons of contexts I was just thinking "didn't they learn anything from perl?".