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 containers -
Adds
.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
container -
Adds
__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 function -
Adds
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