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

fix Some.reduce so it calls f #45

Merged
merged 1 commit into from
Apr 26, 2017
Merged

Conversation

leemhenson
Copy link
Contributor

@leemhenson leemhenson commented Apr 26, 2017

Hi. I'm switch a project over from flow and flow-static-land to ts and fp-ts. In updating a section that used Maybe from flow-static-land to use Option, i noticed that the behaviour changed. It looks to me like reduce on Some isn't quite right, as it never calls f. This is different to how it was in flow-static-land. Is that intentional and should I be using fold directly instead?

I'm still very much in the training-wheels phase with a lot of this stuff, but it strikes me that reduce and fold do very similar things. When should one be used over the other? Is it just that reduce should be used when you don't want to have to deal with converting to Lazy<A> yourself?

@gcanti
Copy link
Owner

gcanti commented Apr 26, 2017

looks to me like reduce on Some isn't quite right, as it never calls f

Indeed is a bug! Thanks @leemhenson. I'll release a patch asap

@gcanti gcanti merged commit 8c66487 into gcanti:master Apr 26, 2017
@gcanti
Copy link
Owner

gcanti commented Apr 26, 2017

@leemhenson leemhenson deleted the option-some-reduce branch May 17, 2018 08:14
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