hamt.js
function updateCollisionList(mutate, edit, keyEq, h, list, f, k, size) {
    var len = list.length;
    for (var i = 0; i < len; ++i) {
        var child = list[i];
        if (keyEq(k, child.key)) {
            var value = child.value;
            var _newValue = f(value);
            if (_newValue === value) return list;

            if (_newValue === nothing) {
                --size.value;
                return arraySpliceOut(mutate, i, list);
            }
            return arrayUpdate(mutate, i, Leaf(edit, h, k, _newValue), list);
        }
    }

    var newValue = f();
    if (newValue === nothing) return list;
    ++size.value;
    return arrayUpdate(mutate, len, Leaf(edit, h, k, newValue), list);
}
function updateCollisionList(mutate, edit, keyEq, h, list, f, k, size) {
    var len = list.length;
    for (var i = 0; i < len; ++i) {
        var child = list[i];
        if (keyEq(k, child.key)) {
            var value = child.value;
            var _newValue = f(value);
            if (_newValue === value) return list;

            if (_newValue === nothing) {
                --size.value;
                return arraySpliceOut(mutate, i, list);
            }
            return arrayUpdate(mutate, i, Leaf(edit, h, k, _newValue), list);
        }
    }

    var newValue = f();
    if (newValue === nothing) return list;
    ++size.value;
    return arrayUpdate(mutate, len, Leaf(edit, h, k, newValue), list);
}
function updateCollisionList ( mutate , edit , keyEq , h , list , f , k , size ) { var len = list . length ; for ( var i = 0 ; i < len ; ++ i ) { var child = list [ i ] ; if ( keyEq ( k , child . key ) ) { var value = child . value ; var _newValue = f ( value ) ; if ( _newValue === value ) return list ; if ( _newValue === nothing ) { -- size . value ; return arraySpliceOut ( mutate , i , list ) ; } return arrayUpdate ( mutate , i , Leaf ( edit , h , k , _newValue ) , list ) ; } } var newValue = f ( ) ; if ( newValue === nothing ) return list ; ++ size . value ; return arrayUpdate ( mutate , len , Leaf ( edit , h , k , newValue ) , list ) ; }
Update an entry in a collision list.

@param mutate Should mutation be used?
@param edit Current edit.
@param keyEq Key compare function.
@param hash Hash of collision.
@param list Collision list.
@param f Update function.
@param k Key to update.
@param size Size ref.
Update an entry in a collision list .