Skip to content

Conversation

@treeowl
Copy link
Contributor

@treeowl treeowl commented Aug 3, 2016

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.

treeowl added 2 commits August 3, 2016 17:16
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`.
* Continue set and map combination rewrites.

* Add bias tests to `Data.Set` suite.

* Replace `Arbitrary` instance for sets.

* Use specialized function to produce pairs of sets
  for combination tests.

This is a horribly large and incomplete commit,
but it all works and I need to move on to some other things.
Sorry, world.
@treeowl treeowl merged commit 66d8bec into haskell:master Aug 6, 2016
@treeowl treeowl deleted the map-combination-update branch August 19, 2016 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant