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

Sequence.map and where should use new this.type instead of [] #28

Closed
kmarekspartz opened this issue Feb 16, 2014 · 3 comments
Closed

Sequence.map and where should use new this.type instead of [] #28

kmarekspartz opened this issue Feb 16, 2014 · 3 comments
Labels
enhancement New feature or refinement to existing one

Comments

@kmarekspartz
Copy link
Contributor

See f8a9d7f#commitcomment-5391488

@kmarekspartz
Copy link
Contributor Author

This wouldn't work for Ranges, as map and filter would have to be written differently anyway. Perhaps FilteredRange and MappedRange classes which takes a function and a range, but still is a Range? Not sure about that.

@munificent
Copy link
Member

Instead of new type, we could define a different create method that List and Range implement and both would return a new list. (Or we could just put that on Sequence.)

But that feels a bit strange. Let's sit on this for now. We've probably got more pressing issues than the corners of subclassing collections.

@munificent munificent added the enhancement New feature or refinement to existing one label Jan 18, 2015
@munificent
Copy link
Member

Old bug is old. :) .map() and .where() return custom lazy sequence types now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or refinement to existing one
Projects
None yet
Development

No branches or pull requests

2 participants