[m-rev.] for review: fix behaviour of bimap.from_assoc_list

Ralph Becket rafe at cs.mu.OZ.AU
Mon Mar 7 15:33:23 AEDT 2005


Ian MacLarty, Monday,  7 March 2005:
> 
> It would be better if there were a version that just failed, since then 
> the user wouldn't need to check the bijective property before calling 
> bimap.from_assoc_list.  This would also be more consistent with other 
> conversion predicates like string.to_int which fail if the conversion is 
> not possible.  I suggest the version which throws an exception should 
> have the usual "det_" prefix.

I disagree.  If the user wants to treat the assoc_list as a sequence of
updates to an empty bimap they should use something like

	BiMap = foldl(bimap.set, AssocList, BiMap0)

-- Ralph
--------------------------------------------------------------------------
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