[commit: packages/containers] cleaned_bugfix394, master, merge-doc-target, merge-fixes-5.9, revert-408-bugfix_394: Quit using deleteFindMin and deleteFindMax (3f6786b)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:45:52 UTC 2017


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

On branches: cleaned_bugfix394,master,merge-doc-target,merge-fixes-5.9,revert-408-bugfix_394
Link       : http://git.haskell.org/packages/containers.git/commitdiff/3f6786b0d7bb90544a266ec792de9a9492d6337c

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

commit 3f6786b0d7bb90544a266ec792de9a9492d6337c
Author: David Feuer <David.Feuer at gmail.com>
Date:   Tue Sep 6 19:37:34 2016 -0400

    Quit using deleteFindMin and deleteFindMax
    
    Stop using `deleteFindMin` or `deleteFindMax` internally, in both
    `Data.Set` and `Data.Map`.
    
    * The `deleteFindMin` and `deleteFindMax` functions are partial,
    and also rather ugly. Reimplement `minView`, `minViewWithKey`, `glue`,
    etc., using total functions. With manual call-pattern specialization,
    this produces pretty core, and slight performance improvements as well.
    I'm not sure why GHC doesn't do that specialization for us, but I
    couldn't seem to convince it to.
    
    * Add `lookupMin` and `lookupMax`, total versions of `findMin`
    and `findMax`, to both `Data.Set` and `Data.Map`. Add `!?`, a
    total version of `!`, to `Data.Map`.


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

3f6786b0d7bb90544a266ec792de9a9492d6337c
 Data/Map/Internal.hs        | 134 +++++++++++++++++++++++++++++++-------------
 Data/Map/Lazy.hs            |   4 +-
 Data/Map/Strict.hs          |   4 +-
 Data/Map/Strict/Internal.hs |   7 ++-
 Data/Set.hs                 |   2 +
 Data/Set/Internal.hs        |  82 ++++++++++++++++++++-------
 changelog.md                |   9 +++
 tests/map-properties.hs     |   8 +++
 tests/set-properties.hs     |   8 +++
 9 files changed, 197 insertions(+), 61 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 3f6786b0d7bb90544a266ec792de9a9492d6337c


More information about the ghc-commits mailing list