FW: FW: cvs commit: fptools/libraries/base package.conf.in fptools/libraries/base/Data IntMap.hs IntSet.hs Map.hs FiniteMap.hs Set.hs

Ross Paterson ross at soi.city.ac.uk
Mon Jan 17 13:34:17 EST 2005

On Mon, Jan 17, 2005 at 04:04:29PM -0000, Simon Marlow wrote:
> Here's a reply from Daan.
> As I see it: we could change all the operations in Data.Set/Data.Map to
> be right-biased, but that's a fair bit of work and might introduce new
> bugs.

Data.FiniteMap had:
	addToFM_C f (unitFM k x) k y = unitFM k (f x y)

the new Data.Map has:
	insertWith f k x (singleton k y) = singleton k (f x y)

Given the new argument order of insertWith, it seems the treatment of
f is obviously right, and one needs to remember to flip them both when
porting.  On the other hand fromList is the same as listToFM.

I think the only problem is union :: Set a -> Set a -> Set a, which has
the same name and type as before, but different semantics.  But then only
people who were abusing sets will suffer.

More information about the Libraries mailing list