[Haskell] Re: Implicit return values

Ben Rudiak-Gould benrg at dark.darkweb.com
Sun Jan 25 17:13:27 EST 2004


On Mon, 26 Jan 2004, Vincenzo aka Nick Name wrote:

> Alle 00:57, luned=EC 26 gennaio 2004, Ben Rudiak-Gould ha scritto:
> >
> >   (123, ^x=3D"foo") - (45, ^x=3D"bar", ^y=3D"baz")
> >
> > would be converted by the compiler to
> >
> >   (123 - 45, ^x=3D("foo" `mappend` "bar"), ^y=3D"baz")
>=20
> It's unclear to me how would the compiler know that it's not
>=20
> (123 - 45, ^x=3D("bar" `mappend` "foo"), ^y=3D"baz")
>=20
> This depends on order of evaluation or am I wrong?=20

No, it depends only on the order of the source code. The value on the left
of the mappend is the value that's leftmost in the original expression.

-- Ben



More information about the Haskell mailing list