[Haskell-cafe] Re: A problem with par and modules boundaries...

Max Rabkin max.rabkin at gmail.com
Sat May 23 14:34:43 EDT 2009


On Sat, May 23, 2009 at 7:31 PM, Mario Blažević <mblazevic at stilo.com> wrote:
> Does anybody know of a pragma or another way to make a function *non-strict* even
> if it does always evaluate its argument? In other words, is there a way to
> selectively disable the strictness optimization?

parallelize a b | False = (undefined, undefined)
                   | otherwise = a `par` (b `pseq` (a, b))

might do, unless strictness analysis is smart enough to know that the
False guard is always, well, False.

--Max


More information about the Haskell-Cafe mailing list