[m-rev.] for review: Add map.merge/4
Paul Bone
paul at bone.id.au
Tue Dec 10 22:23:30 AEDT 2013
On Tue, Dec 10, 2013 at 10:12:32PM +1100, Julien Fischer wrote:
>
> On Tue, 10 Dec 2013, Paul Bone wrote:
>
>> Branches: master
>>
>> Add map.merge/4
>>
>> This version of map.merge takes an additional parameter allowing the callee
>> to specify how conflicting key-value pairs should be handled. This is
>> useful when the values for a given key need to be merged in some way.
>>
>> merge's parameter order looks like: merge(ResulveFunc, MapA, MapB, Map).
>> The current implementation runs in linear time with respect to its first
>> argument, this is different from the existing merge/3 predicate. Before
>> committing this I'd like to determine which argument order is preferred and
>> if it is worthwhile changing the argument order of merge/4 (this
>> contribution) to conform with the established order or somehow transitioning
>> to a new argument order. Another option is using a different name for this
>> slightly different predicate (this may be good regardless of the argument
>> order discussion).
>
> The map module already has an equivalent predicate, map.union/4.
>
Thanks.
I didn't realize.
--
Paul Bone
http://www.bone.id.au
More information about the reviews
mailing list