6 Dec
2004
6 Dec
'04
4:06 p.m.
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, Tomasz