[Haskell-cafe] is value evaluated?
ganesh.sittampalam at credit-suisse.com
Fri May 8 16:31:38 EDT 2009
Brandon S. Allbery KF8NH wrote:
> On May 8, 2009, at 13:08 , Sittampalam, Ganesh wrote:
>> Brandon S. Allbery KF8NH wrote:
>>> and therefore must be in IO. You may be thinking that it would
>>> return a result for _|_, but as described if you fed it _|_ it could
>>> only produce False (if the _|_ has been evaluated you would not be
>>> able to reach the test).
>> It could probably return True in GHC since you can catch exceptions.
>> That still doesn't mean it solves the halting problem, of course.
> 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?
Please access the attached hyperlink for an important electronic communications disclaimer:
More information about the Haskell-Cafe