Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add map and filter algorithms #42

Open
wants to merge 1 commit into
base: Attributes
Choose a base branch
from
Open

Conversation

morrisonlevi
Copy link
Owner

PR #41 added Mappable and Filterable interfaces – this uses those to specialize functions map and filter. This is experimental as well and would like some feedback if possible.

@tklever
Copy link

tklever commented Jan 6, 2016

Any status update on this? I'd love to see Map and Filter reintroduced to this library, but this PR is against files that have been removed entirely. Are there any plans to reimplement these? If so, was there a plan? Is there some way I can assist?

@morrisonlevi
Copy link
Owner Author

The basic idea of having filter and map algorithms that will delegate to an interface if the object implements and otherwise performing a general version is one I would like to explore. If you want to submit a PR that adds them I will commit to at least looking at it and possibly merging it in. Do realize though that this library is still really experimental so even if it makes it in that doesn't mean it stays in. If you are going to work on it put the interfaces in Ardent\Attributes and the algorithms in Ardent\Algorithms like how these PR's did them. Let me know what questions you have.

@tklever
Copy link

tklever commented Jan 6, 2016

Does adding those interfaces to Collection suit you (much like you had before)? Or would you want them implemented individually on the higher level classes (LinkedStack and such)?

@morrisonlevi
Copy link
Owner Author

Do not put it on Collection. The idea for the semantics for these interfaces is that you are implementing it differently than the pure iterator version. Maybe you can use a more efficient traversal, or maybe you can determine that you can quit prematurely - that type of thing. The filter and map functions will provide a fallback general purpose version that works on array and Traversable. Make sense? Any other questions?

@tklever
Copy link

tklever commented Jan 6, 2016

That should be enough for now. Would you want additional functions to follow this pattern as well (reduce, maybe a late sort)?

@morrisonlevi
Copy link
Owner Author

For now just map and filter is enough.

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.

None yet

2 participants