[Haskell] specified or not
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:
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
More information about the Haskell