[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 39, Issue 6

Chad Scherrer chad.scherrer at gmail.com
Thu Nov 2 12:49:17 EST 2006


Lemmih wrote:
> Using 'seq' is generally a bad idea. It can worsen the performance if
> not used carefully and GHCs strictness analyser is usually good
> enough.

Is GHC.Conc.pseq any better? Usually the whole point of making things
more strict is to optimize performance for pieces you know will be
evaluated anyway. It's frustrating if there's not a consistent way to
do this that works well.

Lately, I've been using lots of strictness annotations and bang
patterns - are there non-obvious places this could slow things down?

Would it be possible for the type system to distinguish at compile
time whether something would need to be evaluated, and optimize away
redundant `seq`s? Maybe this is what the strictness analyzer does
already.

Chad


More information about the Haskell-Cafe mailing list