but since calling map(x => x.id) already returns a function
Yes, that example works if map is returning a function, but I guess my read at that point in the article was that map wasn't returning a function.
map
it takes a function (fn) and then some datum (m2)3 it returns the datum as transformed by said function
In which case the example that follows that presupposes it's already a curried implementation was confusing.
...aaaaand I feel like an idiot. I totally see it now! We're still working with (fn, m) => ... and not fn => m => ..., so that doesn't make sense yet. I'll update ASAP. Thanks for your patience, and nice 👀!
(fn, m) => ...
fn => m => ...
Quick fix was to change it to:
const mapId = map.bind(null, x => x.id)
Thanks again.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, that example works if
map
is returning a function, but I guess my read at that point in the article was thatmap
wasn't returning a function.In which case the example that follows that presupposes it's already a curried implementation was confusing.
...aaaaand I feel like an idiot. I totally see it now! We're still working with
(fn, m) => ...
and notfn => m => ...
, so that doesn't make sense yet. I'll update ASAP. Thanks for your patience, and nice 👀!Quick fix was to change it to:
Thanks again.