Hi Jon,

On Thu, 26 Jul 2007, Jon Harrop wrote:

>
> If you have a boolean-or expression:
>
>   a || b
>
> will "a" be evaluated before "b" in Haskell as it is in other languages?
>

Yes, I believe it is defined thus:

True || _    = True
_    || True = True
_    || _    = False

Therefore it is strict in its first argument (it needs to evaluate its
first argument in order to know which pattern match to take).

Chris.

>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to