[m-dev.] And yet another, tuples of state variables.

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 12 14:41:32 AEDT 2007


On Fri, 12 Jan 2007, Ondrej Bojar wrote:

> Hi,
>
> Another construction I tend to type way too often is:
>
>  foldl(
>    (pred(Elem::in,
>          {!.Aku1, !.Aku2}::in,
>          {!:Aku1, !:Aku2}::out) is det :- ..
>
> which could be simplified to:
>
>  foldl(
>    (pred(Elem::in,
>          {Aku1, Aku2}::!(in, out)
> %       or possibly rather
>          !{Aku1, Aku2}::!(in, out)
>
> In other words, !{A, B}  would be considered equal to
>      {!.A, !.B}, {!:A, !:B}
>
> How does it sound to you?

Is there any reason you wouldn't just restructure the arguments of
the closure to work with foldl2?

Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list