[Haskell-cafe] Why is this strict in its arguments?
Stefan O'Rear
stefanor at cox.net
Tue Dec 4 18:15:33 EST 2007
On Tue, Dec 04, 2007 at 03:07:01PM -0800, Ryan Ingram wrote:
> Is there a reason why strictness is defined as
> > f _|_ = _|_
>
> instead of, for example,
> > forall x :: Exception. f (throw x) = throw x
> where an exception thrown from pure code is observable in IO.
>
> In the second case we need to prove that the argument is evaluated at some
> point, which is also equivalent to the halting problem but more captures the
> notion of "f evaluates its argument" rather than "either f evaluates its
> argument, or f _ is _|_"
>
> I suppose the first case allows us to do more eager evaluation; but are
> there a lot of cases where that matters?
"Is there a reason why 2 + 2 is defined as 4 instead of, for example,
5?"
Strictness is more useful in practice, simpler to define, and easier to
approximate.
What benefit does your notion offer?
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071204/3db0f7bd/attachment.bin
More information about the Haskell-Cafe
mailing list