[Haskell-cafe] Re: A suggestion for the next high
profile Haskell project [Was: Re: What is a hacker?]
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Tue Dec 19 16:09:42 EST 2006
On Dec 19, 2006, at 16:03 , minh thu wrote:
> 2006/12/19, Neil Mitchell <ndmitchell at gmail.com>:
>> not_term = non_term
>> f x = 12
>> Now evaluating:
>> main = f non_term
>> In a lazy language the value is always 12, in a strict language its
>> always _|_. Now let's inline f:
>> main = 12
>> In a lazy language the value is still 12, in a strict language the
>> value has changed.
> Sorry, I don't see how it has changed.
> Isn't it still _|_ ? i.e.
No, because inlining f results in the inlined value being 12, where
it used to be _|_. Depending on the optimizer, it may well drop the
call to non_term entirely because it's not being used (thus changing
program semantics), or it may continue to call it (final result will
remain _|_ because the inlined value is never reached).
brandon s. allbery [linux,solaris,freebsd,perl] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
More information about the Haskell-Cafe