Skip to content

AbstractSet is functor#100

Open
kleinschmidt wants to merge 1 commit intoFluxML:masterfrom
kleinschmidt:dfk/set
Open

AbstractSet is functor#100
kleinschmidt wants to merge 1 commit intoFluxML:masterfrom
kleinschmidt:dfk/set

Conversation

@kleinschmidt
Copy link

Currently, Base.Set and possibly other AbstractSets are treated as normal
structs. Since Base.Set{K} wraps a Dict{K,Nothing}, the Set constructor
treats its input as an iterable of values, and Dict iterates Pairs, Sets
end up as Set{Pair{T,Nothing}} after walking.

This adds tests to ensure that Set and OrderedSet (on behalf of all
AbstractSets everywhere) survive fmap.

I'm not 100% sure this is the right way to handle these (generally) un-ordered,
not-natively-mapable collections (I think you might get surprising results
using fmap with multiple arguments for instance. I can work aroudn this with
some lite type piracy but wanted to open this up for discussion anyway!

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