[Haskell-cafe] is value evaluated?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sat May 9 11:38:03 EDT 2009

On May 8, 2009, at 16:31 , Sittampalam, Ganesh wrote:
> Brandon S. Allbery KF8NH wrote:
>> Unless it catches exceptions itself (which strikes me as a bad idea;
>> it becomes a trivial way to ignore exceptions, leading to bad
>> programming practices) either they're handled inside the _|_ (in
>> which case it isn't _|_ from the standpoint of our test) or in an
>> outer scope (in which case our test produces _|_ from the standpoint
>> of the exception handler).
> Surely it just needs to inspect the thunk to decide whether it's _|_  
> or
> not, rather than entering it?

The point is it can never be given a thunk that is _|_ because  
exception handling will have either converted it to a non-_|_ or  
shunted past the test.  And while my earlier com ent suggested that  
the test could conceivably itself do exception handling, you're right  
that all it does is inspect to see if a given thunk has been entered,  
so in fact exception handling shouldn't apply.  In the end, when  
handed _|_ it can only produce False because a _|_ that has been  
entered cannot reach the test.

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090509/7ba35ca6/PGP.bin

More information about the Haskell-Cafe mailing list