[Haskell] Force evaluation

Tomasz Zielonka tomasz.zielonka at gmail.com
Mon Dec 6 11:06:23 EST 2004

On Mon, Dec 06, 2004 at 10:24:06AM -0500, Michael Walter wrote:
> Hi,
> is there a way to force the "full" evaluation of a value (unless seq,
> which only brings the term to WHNF)?
> In my case, I have an algebraic data type Foo,
> and I would like to catch the exceptions that will occur during the
> evaluation of a value of Foo, for something like:
>   foo <- force makeFoo `catch` \e -> defaultFoo

DeepSeq seems to be the most portable solution (can't tell you where to
find it). There is also module Strategies in package concurrent in GHC. I guess
you could also do something like deepSeq with Data.Generics.

Best regards,

More information about the Haskell mailing list