-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Flip the argument order of fluent ap
#96
Conversation
@@ -376,19 +374,20 @@ you chain more over the same structure. It's therefore recommended that you use | |||
traverse a large list (10000+ items). | |||
|
|||
#### ap | |||
##### `#ap :: Future a b ~> Future a (b -> c) -> Future a c` | |||
##### `#ap :: Future a (b -> c) ~> Future a b -> Future a c` |
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.
Should we list type signatures for both ap
and fantasy-land/ap
?
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'm not sure if fantasy-land/ap
deserves a type signature. I believe that conceptually it's not there, and it's functions like Z.ap
which are polymorphic.
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.
My concern is that someone might see the type signature and assume that Fluture targets an old version of FL. It might be worth mentioning in the description that fantasy-land/ap
is FL compliant.
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've added a note about it. Do you think it's sufficient?
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.
Excellent!
Codecov Report
@@ Coverage Diff @@
## 6.0 #96 +/- ##
===================================
Coverage 100% 100%
===================================
Files 36 36
Lines 969 969
===================================
Hits 969 969
Continue to review full report at Codecov.
|
Breaking changes - #80 The ES5 import has been moved from `fluture/es5` to `fluture`. - #80 The `Future#hook` *method* (but not the function) has been removed. - #80 Old environments are asked to bring their own polyfills for `Object.create`, `Object.assign` and `Array.isArray`. - #96 The arguments to the `ap`-method have been flipped back. - #97 `and` and `or` no longer run the two Futures in parallel. - #98 `fromPromise` has been renamed to `encaseP`. New features - #80 Added an ES6 module for use with tools like [Rollup](https://rollupjs.org/). - #80 All transformations, including recursive `chain`, are now stack safe! - #80 Added `isNever`. - #80 Added aliases `attempt = try`, `go = do`, `lastly = finally`. - #98 Added `tryP`, the nullary version of `encaseP`. Bug fixes and improvements - Added fast failure to `encase` and `encaseP`. - #98 Errors thrown while transforming Futures produced by `tryP` or `encaseP` no longer get caught (and silenced) by the Promise. - #80 User-supplied functions no longer have strict arity requirements. - #80 `Future.hook` no longer cancels the acquire Future after it has settled. - #80 `Future.hook` now always cancels running Futures appropriately. - #102 Supplying incompatible or outdated instances of Fluture now throws more sensible error messages.
Flipping the fluent
ap
method has some benefits, as described in #87. These should also be apparent from the changes to the README. I would like to get as many eyes as possible on this because I consider it quite a radical change.