On Saturday 30 Jul 2005 7:07 pm, Daan Leijen wrote: > Efficiency wise, I think one should only provide functions that ensure that > the complexity does not get worse -- if one also considers functionality > that improves on a constant factor (like traversing twice) there is no end > to the number of functions that can be provided (as one is basically doing > deforestation by hand). But this is of course just my personal opinion on > how to control the size of the API.
Actually, I think the point of Chads example is that the function he really needs is not a deforestation of the only solution available to him. The values in the two input maps are already known to satisfy the required condition. The test only needs to be applied on the new combined values (where the maps intersect). So I think it would be worthwhile to produce some kind of unionWithMaybe function. But I have no idea how to do this with IntMaps so I'm not volunteering :-) My 2p.. Regards -- Adrian Hey _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell