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

[email protected] #28

Merged
merged 1 commit into from
Jan 20, 2017
Merged

[email protected] #28

merged 1 commit into from
Jan 20, 2017

Conversation

davidchambers
Copy link
Member

This is a breaking change, but a nice change I think. Do you agree?

Copy link
Member

@safareli safareli left a 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));
Copy link
Member

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)?

Copy link
Member Author

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. ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidchambers davidchambers changed the title update ‘traverse’ and ‘sequence’ to take type representatives [email protected] Jan 17, 2017
@safareli
Copy link
Member

⭐️

@davidchambers davidchambers merged commit 6d8662b into master Jan 20, 2017
@davidchambers davidchambers deleted the dc-traverse-sequence branch January 20, 2017 08:51
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.

2 participants