-
Notifications
You must be signed in to change notification settings - Fork 147
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
Map shouldn't accept a value. Move that to value() #404
Comments
I didn't even realise this was a feature of our |
I agree that it's confusing. I don't even see it being all that useful (as evidenced by the fact that I didn't even know this behavior existed!). Unfortunately, it's documented, and we can't break backwards compatibility in 2.x. Highland contributors, what are your thoughts on changing this behavior in 3.0? |
Definite +1 for 3.0. |
I started using it last week after seeing it in the doc so I suppose that other people use it to and it is indeed a breaking change. +1 though for 3.x. We have some duck typing also in the constructor but I agree that for map it can be a debugging hell. Do we have a solution for deprecation warning ? |
I guess a name like const K = _.curry((x, y) => x);
_([1, 2, 3]).map(K('hi')) // => 'hi', 'hi', 'hi' Although tbh, I'm not sure it warrants a function in the lib given how easy it is roll your own. |
Besides updating the docs to say so? I don't think so.
Having a I will add an entry in our grand list of 3.0 issues (#179). |
This is another instance I think we should be moving towards less functions. We already have things like Edit:
Node has util.deprecate, which warns when a function is used (and can be turned off by command line flags). It also works in browserify. |
Hehe. I was wondering when we'd see you, @quarterto , I remember the trouble I got into when I tried to add the |
Fixed by #408 |
I can see the idea behind allowing map to accept a value, and it's probably useful, but it's also confusing and breaks a long standing contract (the signature of a map function). The reason I'm here is because of this:
This returns a stream of
undefined
.How long did it take you to see the error there? Took me hours.
Highland.value(val)
(there's maybe a better name) would clear this up and save me some sanity.The text was updated successfully, but these errors were encountered: