Fluture Versions Save

🦋 Fantasy Land compliant (monadic) alternative to Promises

7.1.0

6 years ago

:sparkles: New features

  • Added an alt function to use with Alt types such as ConcurrentFuture.
  • Added of, ap, map, alt and zero functions to Par, making the ConcurrentFuture type Static Land -compliant.

:sparkles: Improvements

  • All TypeScript interfaces are now exported.
  • Typescript definitions for ap and map are now overloaded to work on ConcurrentFuture instances as well as Future instances.
  • Added Typescript definitions for extractLeft and extractRight methods.

7.0.0

6 years ago

:warning: Breaking changes

  • #129 Some TypeScript projects might break due to the increased strictness introduced by type definitions.
  • b3851fe The chainRec named export has been removed in favor of regular recursion.

:sparkles: New features

  • #129 Projects which consume Fluture as an ES6 module can now enjoy full TypeScript support!

6.3.0

6 years ago

:sparkles: Improvements

  • #128 The performance of transforming Futures has improved significantly.
  • #131 Future.parallel has been made stack-safe.
  • #131 Future.parallel now guarantees execution order.
  • #132 Improve version interoperability.

:spiral_notepad: Note

6.3.x futures will not be compatible with 6.2.x Futures, so when upgrading, make sure to upgrade all producers of Future instances.

To avoid having to do this with future releases, I recommend setting Fluture as a peerDependency if you are maintaining a library which exposes Future instances to its users.


:bug: Bug fixes since 6.2.6

  • #119 The right-hand Future passed to Future.both was being executed twice under some circumstances.
  • #124 Using Future.parallel with Future.hook in a certain way led to fork() throwing an exception.

6.2.6

6 years ago

:sparkles: New features

  • #111 Add Future.done() and Future#done(): an easy way to fork using a Nodeback.

:bug: Bug fixes and improvements

  • #108 Correct a common typo in many error messages.
  • #109 Fix Static Land compliance of the Future type representative exported by the module build.
  • e24fa0f A problem related to the order in which asynchronous actions were executed was resolved
  • e24fa0f Parallel actions are now cancelled appropriately as one early-terminates
  • 9296445 Optimize when parallel actions are executed
  • 446a27f Prevent asynchronous concurrent actions from running twice
  • 9c5900b Improve chains interoperability of different compatible versions of Fluture
  • f434193 Make Future#both() cancel the other when the one rejects.

6.0.1

7 years ago

:warning: 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 The Future#cache 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.
  • 1a636d5 chainRec is no longer curried and direct use is now discouraged.

:sparkles: New features

  • #80 Added an ES6 module for use with tools like Rollup.
  • #80 All transformations, including recursive chain, are now stack safe!
  • #80 Added isNever.
  • #98 Added tryP, the nullary version of encaseP.

:bug: Bug fixes and improvements

  • #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.
  • #80 Added aliases attempt = try, go = do, lastly = finally.
  • #102 Supplying incompatible or outdated instances of Fluture now throws more sensible error messages.
  • 192c34b Added fast failure to encase and encaseP.

5.0.0

7 years ago

Compare 4.3.5...5.0.0

:warning: Breaking changes

  • #74 The argument order of Future.or() has been flipped
  • #75 Future.isForkable() has been removed
  • #75 Future.fromForkable() has been removed
  • #75 Future.cast() has been removed
  • #59 (Sanctuary) S.is(Future, Future.of(1)) now returns true rather than false
  • #59 (Sanctuary) Fluture now requires its type to be defined to be used in polymorphic functions

:sparkles: New features

  • #70 Add a new ConcurrentFuture type

:bug: Bug fixes and improvements

  • #59 Fluture now recognizes Futures from other versions of Fluture as valid Futures
  • #4 #69 All curried functions now fail fast
  • #73 Future.finally() now runs finally computation when cancelled

4.0.0

7 years ago

Compare 3.1.1...4.0.0

:warning: Breaking changes (see upgrading below)

  • Future.recur has been removed in favor of Future.chainRec.
  • #38 Future.ap is no longer parallel. Instead one might use Future.and or Future.both.
  • #38 of and fantasy-land/chainRec are no longer available on the prototype.

:sparkles: New features

  • #34 Casting a Future to string now shows a much more friendly representation.
  • #39 Future.rejectAfter has been added as a counterpart to Future.after.
  • #40 Future.and has been added as a counterpart to Future.or.
  • #41 Future.both has been added as an alias to Future.parallel(2, [a, b]).
  • #42 Static ap, map, bimap and chain functions can now handle native algebraic data types, courtesy of sanctuary-type-classes.

:bug: Bug fixes and improvements

  • #4 Several curried functions have been made to fail the moment they receive an invalid argument.
  • #34 When a cached Future is cancelled, its other subscribers are not unsubscribed.
  • #34 When a hooked Future is cancelled, the disposal Future is still forked (and cancelled).
  • #34 Some Futures were not being automatically cancelled when no longer needed.
  • #42 Improved string representations of values in error messages, courtesy of sanctuary-type-classes.

:rocket: Performance

  • #34 Performance of Future.race has trippled.
  • #34 Performance of Future.cache has doubled.
  • #34 Performance of Future.chainRec has improved by 50%.
  • #34 Performance of Future.parallel has improved by 30%.
  • #34 Performance of all other functions has improved by 10%-20%.

:arrow_up: Upgrading

Refactor code using Future.recur into code using Future.chainRec

const repeat = (x) => Future.after(10, x).map(add(1)).recur(repeat);
repeat(1).fork(...)
  • becomes
Future.chainRec((next, done, x) => Future.after(10, x).map(add(1)).map(next), 1)
.fork(...)

Use Future.both over Future.ap for parallelism

Future.of(1).ap(Future.of(add(1)))
  • becomes
Future.of(1).both(Future.of(add(1))).map(([x, f]) => f(x))

Use Future.parallel(Infinity) over sequence(Future.of)

sequence(Future.of, [m1, m2, m3])
  • becomes
Future.parallel(Infinity, [m1, m2, m3])

Access of via constructor property

const empty = m => m.of()
  • becomes
const empty = m => m.constructor.of()

3.1.0

7 years ago
  • Add FantasyLand compatible .chainRec() function
  • Improve overall performance
  • Make .do() memory- and stack-safe

3.0.0

7 years ago

The argument order of the ap method has been flipped in order to comply to the FantasyLand 1.0 spec.

2.0.1

7 years ago

Ensures cancel functions of settled Futures are never called.