Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Set comprehensions #30

Open
robrix opened this issue Jan 19, 2015 · 2 comments
Open

Set comprehensions #30

robrix opened this issue Jan 19, 2015 · 2 comments

Comments

@robrix
Copy link
Owner

robrix commented Jan 19, 2015

e.g. some syntax to match the typical set-builder notation of { π‘₯ ∈ 𝐴 | proposition(π‘₯) }.

This is probably infeasible with the extant Dictionary-based Set (since it trivially lends itself to infinite sets, and in general should be lazy), but a SetType protocol could allow us to abstract the notion of sets appropriately for this purpose.

It would likely also be necessary to distinguish between Set and MutableSet at that point, since a set comprehension stored in a var is probably still immutable.

It may be valuable to consider set comprehensions as inductive construction of sets rather than as filtering of some domain set. Likewise, it may be valuable to consider the proposition not as a predicate but as a flat map, since that allows us to recover both maps and filters.

@robrix robrix self-assigned this Jan 19, 2015
@robrix
Copy link
Owner Author

robrix commented Jan 20, 2015

cf #2 for the protocol.

@sharplet
Copy link
Collaborator

πŸ’₯

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants