[Haskell-cafe] Re: A suggestion for the next high
profile Haskell project [Was: Re: What is a hacker?]
noteed at gmail.com
Tue Dec 19 16:39:11 EST 2006
2006/12/19, Brandon S. Allbery KF8NH <allbery at ece.cmu.edu>:
> 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).
Thank you, I see now.
More information about the Haskell-Cafe