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

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 12 23:03:53 AEDT 2007


On Fri, 12 Jan 2007, Ondrej Bojar wrote:

> Julien Fischer wrote:
>>> which could be simplified to:
>>> 
>>>  foldl(
>>>    (pred(Elem::in,
>>>          !{Aku1, Aku2}::!(in, out)
>>> 
>>> In other words, !{A, B}  would be considered equal to
>>>      {!.A, !.B}, {!:A, !:B}
>> Is there any reason you wouldn't just restructure the arguments of
>> the closure to work with foldl2?
>
> There are many ADTs that have some sort of fold implemented (fold_up, down, 
> left, right, topleft...) but very few have also all fold2, fold3, fold4 
> variants...

If these ADTs are part of the Mercury library then you only
need to ask ...

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