[m-dev.] for review: added two utility functions to list.m

Ralph Becket rbeck at microsoft.com
Thu Mar 1 03:50:44 AEDT 2001


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
>
> >         Added list__zip_with/3 function.
> 
> I don't think the name `zip_with' is a good idea here, because that
> suggests a relationship with `zip', but this function is unrelated to
> Mercury's `list__zip' -- Mercury's `list__zip' does something quite
> different to Haskell's `zip'.
> 
> Unfortunately I can't think of any great alternatives off-hand.
> Suggestions?

How about `list__map_corresponding'?  Personally, I think
`list__interleave' is a better name for `list__zip', but it's
probably too late to change now.

 
> As for the implementation, I think it would be more consistent
> with the code elsewhere for that function to call error/1
> (i.e. throw a `software_error' exception) rather than throwing
> a raw string.

Okay, I'll fix that.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list