returns v0.14.0 Release Notes

Release Date: 2020-06-07 // almost 4 years ago
  • Special thanks to:

    Announcement: https://sobolevn.me/2020/06/how-async-should-have-been

    ๐Ÿ”‹ Features

    ๐Ÿ’ฅ Breaking : renames mypy plugin from decorator_plugin to returns_plugin
    because of a complete rewrite and lots of new features

    ๐Ÿ’ฅ Breaking : changes @safe, @impure, impure_safe, @maybe semantics:
    they do not work with async functions anymore;
    now you are forced to use Future and its helpers
    to work with async functions

    ๐Ÿ’ฅ Breaking : renames Maybe.new to Maybe.from_value.
    ๐Ÿ‘ Because all our other containers support this protocol.
    Only Maybe was different, sorry for that!

    ๐Ÿ’ฅ Breaking : renames .from_success() to .from_value(),
    there's no need in two separate methods

    ๐Ÿ’ฅ Breaking : renames .from_successful_io() to .from_io(),
    there's no need in two separate methods

    ๐Ÿ’ฅ Breaking : renames .from_successful_context() to .from_context(),
    there's no need in two separate methods

    ๐Ÿ’ฅ Breaking : since we now support .apply() method,
    ๐Ÿšš there's no more need in *_squash converters, they are removed

    ๐Ÿ’ฅ Breaking : renamed Instanceable to Applicative

    ๐Ÿ’ฅ Breaking : changes .from_io and .from_failed_io of IOResult
    to return Any instead of NoReturn unfilled type

    ๐Ÿ’ฅ Breaking : removes .lift and .lift_* methods from all containers,
    use map_, bind_result, bind_io, and other pointfree helpers instead

    ๐Ÿ’ฅ Breaking : removes @pipeline function. It was a mistake:
    it does not work with mixed container types,
    it does not type failures properly,
    it does not work with IO and Future,
    it enforces to write imperative code in a functional codebase.
    ๐Ÿ‘‰ Use flow instead

    โž• Adds typed partial and curry mypy plugins!

    โž• Adds typed flow plugin, now it can accept any number of arguments,
    it now also has excelent type inference

    โž• Adds typed pipe plugin, now it can accept any number of arguments,
    it now also has good type inference

    โž• Adds managed pipeline function that is useful
    for working with stateful computations

    โž• Adds typed map_, fix, and alt pointfree functions

    Adds typed bind_result, bind_io, bind_ioresult,
    bind_context, bind_context_result, bind_future,
    bind_async, and bind_awaitable pointfree functions

    Adds typed bind_async_future and bind_async_future_result
    pointfree functions

    โž• Adds typed unify pointfree function

    โž• Adds typed apply pointfree function

    โž• Adds typed value_or pointfree function

    โž• Adds pytest plugin with the ability to tests error handling

    โž• Adds Future container to easily work with async functions

    โž• Adds FutureResult container to easily work
    with async function that might fail

    โž• Adds RequiresContextFutureResult container

    โž• Adds ReaderFutureResult alias for RequiresContextFutureResult

    โž• Adds RequiresContextFutureResultE and ReaderFutureResultE aliases

    โž• Adds Future, FutureResult and RequiresContextFutureResult
    ๐Ÿ‘Œ support for all existing pointfree functions

    โž• Adds bind_io method to IOResult

    โž• Adds bind_io method to RequiresContextIOResult

    โž• Adds or_else method to Maybe

    Adds .from_io and .from_failed_io to RequiresContextIOResult

    Syncs naming in from_* methods, now all parameters are named inner_value

    โž• Adds not_ composition helper

    โž• Adds flatten support for Future,
    FutureResult and RequiresContextFutureResult

    Adds __copy__ and __deepcopy__ magic methods to Immutable class

    Speeds up is_successful function

    ๐Ÿ‘‰ Makes all Context context helpers abstract,
    so you cannot create new instances of this class,
    also adds __slots__ to these classes

    ๐Ÿ‘Œ Improves RequiresContext* types with NoDeps where it is logically true

    ๐Ÿ›  Bugfixes

    • ๐Ÿ›  Fixes that @safe decorator was generating incorrect signatures
      for functions with Any
    • ๐Ÿ›  Fixes that .rescue() of RequiresContextResult was returning Any
    • ๐Ÿ›  Fixes that .rescue() of RequiresContextIOResult was returning Any
    • ๐Ÿ›  Fixes that RequiresContextResult and RequiresContextIOResult
      were not final
    • ๐Ÿ›  Fixes that ImmutableStateError was not a subclass of AttributeError
    • ๐Ÿ›  Fixes that IOResult was not showing str representation
      of wrapped inner_value

    Misc

    • โœ… Replaces pytest-asyncio with anyio plugin,
      โœ… now we test compatibility with any IO stack: asyncio, trio, curio
    • โšก๏ธ Updates lots of dependencies
    • โž• Adds lots of new tests
    • โšก๏ธ Updates lots of docs
    • โœ‚ Removes "IO marker" name from docs in favor for "IO container",
      it is not special at all. Why would we call it differently?