-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
[email protected] #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change 👍
Also if someone used custom function instead of TypeRep[fl.of]
they could still use it:
Z.traverse({ [fl.of]: (a) => ... }, f, xs)
@@ -76,7 +76,7 @@ List.prototype[FL.reduce] = function(f, x) { | |||
List.prototype[FL.traverse] = function(f, of) { | |||
return this.tag === 'Nil' ? | |||
of(Nil) : | |||
Z.ap(Z.map(curry2(Cons), f(this.head)), Z.traverse(of, f, this.tail)); | |||
Z.ap(Z.map(curry2(Cons), f(this.head)), this.tail[FL.traverse](f, of)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part was a bit confusing, why not call Z.traverse(List, f, this.tail)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of
is not necessarily List['fantasy-land/of']
(in fact, it almost certainly is not). We have no way of getting from of
to a type representative, so we're forced to use the of
-based API rather than our API based on type representatives.
If we update fantasy-land/traverse
to take a type representative this problem will disappear. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
⭐️ |
95c54d8
to
66e1402
Compare
b8e5cf8
to
aa6f7af
Compare
aa6f7af
to
332c42f
Compare
This is a breaking change, but a nice change I think. Do you agree?