[Haskell-cafe] Re: Is id strict?

Jón Fairbairn jon.fairbairn at cl.cam.ac.uk
Sun Jul 30 08:22:45 EDT 2006

Duncan Coutts <duncan.coutts at worc.ox.ac.uk> writes:

> On Sun, 2006-07-30 at 10:56 +0100, Jón Fairbairn wrote:
> > "David House" <dmhouse at gmail.com> writes:
> > > 1) f is strict iff f _|_ = _|_.
> > > 2) f is strict iff it forces evaluation of its arguments.
> > 
> > In (2), you have to be evaluating f on an argument before f
> > can force the argument.  If you evaluate id x, you
> > necessarily evaluate x.  I don't think (2) is a very good
> > definition, since I don't know what "forces" means here.
> Surely it just means evaluate to weak head normal form?

Means [what] evaluate[s] to whnf? id doesn't do any
evaluating, in fact functions in general don't do any

> Definition 2) relies on following a certain evaluation strategy: that
> operationally, functions always return results in weak head normal form.
> GHC follows this strategy. It's possibly to imagine returning thunks and
> then getting the caller to force the evaluation to WHNF.

Which is pretty much my point. Use a definition of "strict"
that doesn't depend on anything but denotations (or Böhm

Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk

More information about the Haskell-Cafe mailing list