[Haskell-cafe] Haskell performance question

Mikhail Gusarov dottedmag at dottedmag.net
Thu Nov 8 13:51:04 EST 2007

"Dan Piponi" <dpiponi at gmail.com> writes:

> Even though 'n' is 10 times bigger in the C program it runs much
> faster than the Haskell program on my MacBook Pro with Haskell 6.6.1.
> I've tried lots of different combinations of flags that I've found in
> various postings to haskell-cafe but to no avail.

import Data.List

main = do
  print $ foldl' (+) 0 $ take 100000000 [1.0,1.0..]

works 10 times faster than your C version. You just need to adapt to the
radically different style of programming.

Real Fortran programmer may write Fortran programs on any programming
language :)

JID: dottedmag at jabber.dottedmag.net

More information about the Haskell-Cafe mailing list