returns v0.15.0 Release Notes

Release Date: 2020-10-21 // over 3 years ago
  • ๐Ÿ”‹ Features

    โž• Adds Higher Kinded Types partial support

    ๐Ÿ’ฅ Breaking : drops python3.6 support

    ๐Ÿ’ฅ Breaking : makes our mypy plugin not optional, but required!

    ๐Ÿ’ฅ Breaking : changes all RequiresContext-based type arguments order,
    previously we used to specify _EnvType as the first type argument,
    now it is the last one. This is done to respect new HKT rules

    ๐Ÿ’ฅ Breaking : renames .rescue to .lash

    ๐Ÿ’ฅ Breaking : removes all old interfaces from primitives/interfaces.py,
    ๐Ÿ‘‰ use new typeclasses instead

    ๐Ÿ’ฅ Breaking : Maybe is fully reworked to be lawful

    ๐Ÿ’ฅ Breaking : removes value_or pointfree method,
    because it is impossible to express with HKT

    ๐Ÿ’ฅ Breaking : removes .value_or, .unwrap, and .failure methods
    from FutureResult and RequiresContext-based types,
    ๐Ÿ‘ป because we do require these methods to raise an exception on failure,
    ๐Ÿ‘ป but these methods were lazy and did not raise the required exception

    ๐Ÿ’ฅ Breaking : changes how is_successful is typed:
    now we allow any Unwrappable interface instances there,
    including custom ones

    ๐Ÿ’ฅ Breaking : changes UnwrapFailedError constructor,
    now it does accept an Unwrappable instance instead of a BaseContainer

    ๐Ÿ’ฅ Breaking : removes .fix method from all containers,
    ๐Ÿšš also removes fix pointfree function

    ๐Ÿ’ฅ Breaking : Removes coalesce function,
    because it is impossible to properly type it

    ๐Ÿ’ฅ Breaking : Removes all Context* based types with .ask() method,
    ๐Ÿ‘‰ use new .ask() methods on the Reader-based containers

    ๐Ÿ’ฅ Breaking : Now Future and FutureResult can be awaited multiple times

    ๐Ÿ’ฅ Breaking : Removes .unify() method from several containers,
    ๐Ÿ‘‰ use unify() pointfree function instead

    ๐Ÿ’ฅ Breaking : Removes .from_iterable method from all containers,
    ๐Ÿ‘ instead adds better iterables support,
    we now have returns.iterables module with Fold helper

    ๐Ÿ’ฅ Breaking : Renames property empty to no_args of
    all RequiresContext-based classes

    โž• Adds new public interfaces: see returns.interfaces

    โž• Adds methods package with several helpful things inside

    โž• Adds FutureSuccess and FutureFailure unit functions
    to be similar to Result and IOResult

    โž• Adds .swap method to Result, IOResult, FutureResult,
    and other result based containers

    Adds .modify_env method to all RequiresContext* types

    โž• Adds .rescue to Maybe

    โž• Adds .equals methods to types that can be compared directly:
    Result, Maybe, IO, IOResult

    Adds missing from_requires_context_future_result to RequiresContext

    Adds .from_optional and .bind_optional to Maybe container

    Adds __slots__ to UnwrapFailedError with halted_container

    ๐Ÿ”„ Changes flatten to work with KindN and any possible container

    โž• Adds a helper to test traces to our pytest plugin

    โž• Adds cond function to pointfree and methods packages

    โž• Adds compose_result HKT method and pointfree function

    โž• Adds unify HKT pointfree function

    โž• Adds bimap pointfree function

    Adds unwrap_or_failure function to methods package

    โž• Adds collect_trace helper function for better development experience

    โž• Adds hypothesis intergration and pre-defined "monad laws as values"

    โž• Adds assert_equal method to our pytest plugin

    ๐Ÿ›  Bugfixes

    • ๐Ÿ’ฅ Breaking : fixes serious typing issue and changes how flow works
    • ๐Ÿ’ฅ Breaking : fixes serious typing issue and changes how pipe works,
      now it has a hard limit of 20 parameters
    • ๐Ÿ›  Fixes that RequiresContextFutureResult was not supported by pytest plugin
    • ๐Ÿ›  Fixes incorrect partial behaviour in an edge case, #618
    • ๐Ÿ›  Fixes that .apply method of IOResult was working incorrectly,
      it was returning IOFailure(2)
      as a result of IOFailure(1).apply(IOFailure(2))
    • ๐Ÿ›  Fixes bug that safe(tap(...)) was revealing invalid types sometimes

    Misc

    • โž• Adds a lot of new typetests
    • Checks that now all math laws are checked for all types
    • ๐Ÿ”„ Changes docs structure, adds new Interfaces, HKT, and Methods pages
    • Changed __str__ method in BaseContainer class to __repr__ method
    • โž• Adds Quickstart guide