[Haskell-cafe] is value evaluated?
Sittampalam, Ganesh
ganesh.sittampalam at credit-suisse.com
Fri May 8 13:08:39 EDT 2009
Brandon S. Allbery KF8NH wrote:
> On May 8, 2009, at 01:33 , Joe Fredette wrote:
>> That strikes me as being bad in a "I'm violating the Halting Problem"
>> sort of way- but I'm not sure how. Is there some contradictory
>> construction that could be built from such a function?
>
> I don't think it is; surely the Haskell runtime knows which thunks it
> has evaluated. It just explicitly violates referential transparency,
> 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.
Ganesh
===============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================
More information about the Haskell-Cafe
mailing list