[Haskell-cafe] Why are && and || right-associative?

Brandon Allbery allbery.b at gmail.com
Sat Apr 13 01:47:57 UTC 2019


Exactly. Short-circuiting is emulating laziness in this one case where it
turns out to be generally useful. And while (_|_ && _|_) may be evaluatable
from a logical standpoint, computer languages tend to not do well with it:
regardless of how it evaluates, (&&) is going to try to force at least one
of the bottoms.

On Fri, Apr 12, 2019 at 9:19 PM Theodore Lief Gannon <tanuki at gmail.com>
wrote:

> I think Brandon's point is that short-circuiting is in fact an example of
> lazy evaluation, regardless of the language being otherwise strict.
>
> On Fri, Apr 12, 2019, 4:52 PM Stefan Monnier <monnier at iro.umontreal.ca>
> wrote:
>
>> > Er? Without laziness, you're going to try to evaluate the bottoms
>> > regardless of where they are.
>>
>> Exactly: with lazyness, either associativity gives the same result,
>> and without lazyness either associativity also gives the same result.
>> The two seem orthogonal to me.
>>
>>
>>         Stefan
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190412/78e62e2e/attachment.html>


More information about the Haskell-Cafe mailing list