On Thursday 26 July 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.

The definition of (||) is roughly

True || b = True
False || b = b

Which de-sugars to

(||) = \ a b -> case a of
  True -> True
  False -> b

Which does exactly what you want.

Jonathan Cast
http://sourceforge.net/projects/fid-core
http://sourceforge.net/projects/fid-emacs

Attachment: pgpHiL6AGRotf.pgp
Description: PGP signature

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

Reply via email to