[m-rev.] for review: bug fix for try_all/2

Simon Taylor stayl at cs.mu.OZ.AU
Wed Dec 8 19:54:54 AEDT 2004


On 08-Dec-2004, Mark Brown <mark at cs.mu.OZ.AU> wrote:
> Fix a bug in try_all/2 in the library.  The documentation says that it puts
> the exception at the end of the result list, but the implementation puts
> it at the start (and the test case in tests/hard_coded/exceptions checks
> that the exception is at the start).
> 
> The fix is to change the documentation to match the implementation.  The
> rationale for this decision is that it is probably more useful to have the
> exception at the start of the list where its presence or absence can be
> easily checked.

That's a pretty awful interface.
Wouldn't something like the following be better?

	% try_all(Pred, MaybeException, ResultsUpToException)
:- pred try_all(pred(T), maybe(univ), list(T)).

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list