Skip to content

Major async overhaul [breaking changes!]

Pre-release
Pre-release
Compare
Choose a tag to compare
@louthy louthy released this 27 Dec 01:13
dbf40b3

This is an alpha release of the initial phase of the async overhaul of language-ext.

  • New type-classes for asynchronous types: MonadAsync, ApplicativeAsync, FunctorAsync, FoldableAsync, BiFoldableAsync
  • Improved implementations of the class-instances for asynchronous types: MTask, ApplTask, FTask, MTryAsync, ApplTryAsync, FTryAsync, MTryOptionAsync, ApplTryOptionAsync, FTryOptionAsync, MOptionAsync, ApplOptionAsync, FOptionAsync,
  • New asynchronous EitherAsync type with associated MEitherAsync, ApplEitherAsync, FEitherAsync implementations.
  • Overhauled transformer extensions for nested monads so only behaviours that can run without forcing asynchronous monads to run synchronously are available.
  • Constructor functions for asynchronous types now work with Task rather than Func

All existing unit-tests pass although some tests had to be updated due to the breaking changes.

The main breaking changes you will see are:

  • Constructor functions for asynchronous types won't accept plain Funcs any more - they must return Tasks
  • Some extension methods in the transformer system now return Task<A> where they previously forced synchronous return value of A
  • To reduce the problems of method resolution a large number of methods have been renamed to have Async suffixes - so if your function doesn't exist anymore then check if there is an methodNameAsync variant.
  • The async functionality previously attached to the synchronous class instances has now gone (so FoldAsync isn't on MOption any more for example)