[Haskell] specified or not
Arthur Baars
arthurb at cs.uu.nl
Thu Mar 3 09:56:19 EST 2005
Evaluation is driven by pattern matching, and the order of pattern
matching is specified. The order is left to right, outside to inside.
See section 3.17 of the Haskell Report:
http://www.haskell.org/onlinereport/exps.html#sect3.17
Arthur
On 3-mrt-05, at 15:39, Scott Turner wrote:
> Is the behavior of evaluating z unspecified?
> z = f (0, z)
> f x = case x of
> (1,1) -> z
> _ -> 0
> Hugs and GHC agree that z evaluates to 0. However, if the first line is
> changed to
> z = f (z,0)
> then both implementations loop. In other words, the behavior depends
> on order
> of evaluation, which AFAIK is not specified.
> _______________________________________________
> Haskell mailing list
> Haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
More information about the Haskell
mailing list