[mercury-users] Additions to list.m

Ralph Becket rafe at csse.unimelb.edu.au
Tue Aug 8 09:21:44 AEST 2006


Nicholas Nethercote, Monday,  7 August 2006:
> On Mon, 7 Aug 2006, Julien Fischer wrote:
> 
> >On Mon, 7 Aug 2006, Nicholas Nethercote wrote:
> >
> >>list.m has lots of variants and combinations of map, fold and filter.  
> >>I'm guessing these are added on demand.
> >
> >That's what usually happens.
> >
> >>If so, I'd like to request that
> >>map_corresponding3_foldl and map2_foldl3 be added.
> >
> >Okay.  What modes do you need?
> 
> Just the simplest in/out/det ones:
> 
> :- pred map2_foldl3(pred(L, M, N, A, A, B, B, C, C), list(L), list(M),
>         list(N), A, A, B, B, C, C).
> :- mode map2_foldl3(pred(in, out, out, in, out, in, out, in, out) is det,
>         in, out, out, in, out, in, out, in, out) is det.
> 
> :- pred map_corresponding3_foldl(pred(A, B, C, D, list(E), list(E)), 
> list(A),
>         list(B), list(C), list(D), list(E), list(E)).
> :- mode map_corresponding3_foldl(pred(in, in, in, out, in, out) is det, in,
>         in, in, out, in, out) is det.
> 
> but I would have guessed you'd add all the ones that the other variants 
> have (ie. some di/uo ones, and ones with different determinisms) for 
> consistency.

This is getting to the point that it's probably worth writing a list
comprehension generator script in Awk or something...
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list