[commit: packages/containers] cleaned_bugfix394, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-408-bugfix_394: Continue to improve map functions (11cd73c)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:44:43 UTC 2017


Repository : ssh://git@git.haskell.org/containers

On branches: cleaned_bugfix394,master,merge-doc-target,merge-fixes-5.9,merge-restrict-fix-5.8,revert-408-bugfix_394
Link       : http://git.haskell.org/packages/containers.git/commitdiff/11cd73c643c4dd1854c18abeea0738862168971c

>---------------------------------------------------------------

commit 11cd73c643c4dd1854c18abeea0738862168971c
Author: David Feuer <David.Feuer at gmail.com>
Date:   Mon Aug 1 17:40:14 2016 -0400

    Continue to improve map functions
    
    Rewrite `unionWith`, `intersectionWithKey`, etc., as independent
    functions. Writing either in terms of the other leads to closures
    being allocated with extra indirection for the passed function.
    `mergeWithKey` misses singleton optimizations for unions. For the
    rest, I think `mergeWithKey` is hard to understand, and it's not
    immediately obvious how the parts are supposed to fit together.
    Since it's used only to reduce *source* code size, and not actual
    *generated* code size, I'd rather avoid it for the most part.
    I've left `differenceWith` and `differenceWithKey` alone, as they
    appear to be rather deeply tied to the concepts in `mergeWithKey`.


>---------------------------------------------------------------

11cd73c643c4dd1854c18abeea0738862168971c
 Data/Map/Base.hs          | 295 +++++++++++++++++++++++++++++++++++-----------
 Data/Map/Strict.hs        |  92 ++++++++++++++-
 Data/Set/Base.hs          |  11 +-
 Data/Utils/PtrEquality.hs |   6 +-
 tests/map-properties.hs   |  32 ++++-
 tests/set-properties.hs   |  27 +++++
 6 files changed, 382 insertions(+), 81 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 11cd73c643c4dd1854c18abeea0738862168971c


More information about the ghc-commits mailing list