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
fromFutureResult
andRequiresContext
-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 anyUnwrappable
interface instances there,
including custom ones๐ฅ Breaking : changes
UnwrapFailedError
constructor,
now it does accept anUnwrappable
instance instead of aBaseContainer
๐ฅ Breaking : removes
.fix
method from all containers,
๐ also removesfix
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 theReader
-based containers๐ฅ Breaking : Now
Future
andFutureResult
can be awaited multiple times๐ฅ Breaking : Removes
.unify()
method from several containers,
๐ useunify()
pointfree function instead๐ฅ Breaking : Removes
.from_iterable
method from all containers,
๐ instead adds betteriterables
support,
we now havereturns.iterables
module withFold
helper๐ฅ Breaking : Renames property
empty
tono_args
of
allRequiresContext
-based classesโ Adds new public interfaces: see
returns.interfaces
โ Adds
methods
package with several helpful things insideโ Adds
FutureSuccess
andFutureFailure
unit functions
to be similar toResult
andIOResult
โ Adds
.swap
method toResult
,IOResult
,FutureResult
,
and other result based containersAdds
.modify_env
method to allRequiresContext*
typesโ Adds
.rescue
toMaybe
โ Adds
.equals
methods to types that can be compared directly:
Result
,Maybe
,IO
,IOResult
Adds missing
from_requires_context_future_result
toRequiresContext
Adds
.from_optional
and.bind_optional
toMaybe
containerAdds
__slots__
toUnwrapFailedError
withhalted_container
๐ Changes
flatten
to work withKindN
and any possible containerโ Adds a helper to test traces to our
pytest
pluginโ Adds
cond
function topointfree
andmethods
packagesโ Adds
compose_result
HKT method and pointfree functionโ Adds
unify
HKT pointfree functionโ Adds
bimap
pointfree functionAdds
unwrap_or_failure
function tomethods
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 ourpytest
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 bypytest
plugin - ๐ Fixes incorrect
partial
behaviour in an edge case, #618 - ๐ Fixes that
.apply
method ofIOResult
was working incorrectly,
it was returningIOFailure(2)
as a result ofIOFailure(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
, andMethods
pages - Changed
__str__
method inBaseContainer
class to__repr__
method - โ Adds
Quickstart
guide
- ๐ฅ Breaking : fixes serious typing issue and changes how