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

Brandon Allbery allbery.b at gmail.com
Fri Apr 12 23:35:05 UTC 2019


Er? Without laziness, you're going to try to evaluate the bottoms
regardless of where they are. Or are you asserting that the
short-circuiting done by many strict languages is their standard evaluation
model?

On Fri, Apr 12, 2019 at 7:32 PM Stefan Monnier <monnier at iro.umontreal.ca>
wrote:

> >> I don't know the historical answer, but I think it's because the true
> >> fixity can't be expressed in Haskell.
> > No, the historical answer is that with lazy evaluation the
> > shortcutting happens in the expected order. We did think about
> > that.
>
> I don't understand how laziness enters the picture:
>
>     (False && ⊥) && ⊥ ≡ False
>     False && (⊥ && ⊥) ≡ False
>
> in both cases we get the same result.
>
>
>         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.



-- 
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/a2f3a6c6/attachment.html>


More information about the Haskell-Cafe mailing list