Changelog History
Page 1
-
v0.19.1 Changes
๐ Bugfixes
- ๐ Fixes a problem with
do-notation
and type aliases - ๐ Fixes custom pickle protocol to handle
None
values gracefully - โ Removes broken drylabs.io link in README
- ๐ Revises pointfree documentation
- ๐ Fixes a problem with
-
v0.19.0 Changes
๐ Features
- โ Adds
do
notation - โ Adds
attempt
decorator
Misc
- Check
__slots__
correctness withslotscheck
- โ Adds
-
v0.18.0 Changes
๐ New Year Release! ๐
๐ Features
- Now requires
typing_extensions>=4.0
- Now requires
mypy>=0.930
- โ Removes plugin for
@safe
,@maybe
,@future
, etc. Because we now useParamSpec
type to properly type decorators
๐ Bugfixes
- Fixes
__slots__
not being set properly in containers and their base classes - ๐ Fixes patching of containers in pytest plugin not undone after each test
- Now requires
-
v0.17.1 Changes
๐ Bugfixes
- Fixes
__slots__
not being set properly in containers and their base classes - ๐ Fixes patching of containers in pytest plugin not undone after each test
- Fixes
-
v0.17.0 Changes
๐ Features
- ๐ Enables Pattern Matching support for
Result
containers - ๐ Enables Pattern Matching support for
Maybe
container - ๐ Enables Pattern Matching support for
IOResult
container - ๐ Improves
hypothesis
plugin, now we detect when type cannot be constructed and give a clear error message - โ Adds the option to pass what exceptions
@safe
will handle
- ๐ Enables Pattern Matching support for
-
v0.16.0 Changes
๐ Features
- ๐ Makes
_Nothing
a singleton - ๐จ Refactor
flow
function to be faster
๐ Bugfixes
- ๐ Fixes that
assert_trace
was not catching containers from@safe
-wrapped functions
Misc
- ๐ Fixes typos in documentation
- ๐ Makes
-
v0.15.0 Changes
October 21, 2020๐ 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
-
v0.14.0 Changes
June 07, 2020Special thanks to:
- @orsinium
- @thedrow
- @thepabloaguilar
- and other (code and ideas) contributors
๐ for making this release possible. You are awesome!
Announcement: https://sobolevn.me/2020/06/how-async-should-have-been
๐ Features
๐ฅ Breaking : renames mypy plugin from
decorator_plugin
toreturns_plugin
because of a complete rewrite and lots of new features๐ฅ Breaking : changes
@safe
,@impure
,impure_safe
,@maybe
semantics:
they do not work withasync
functions anymore;
now you are forced to useFuture
and its helpers
to work withasync
functions๐ฅ Breaking : renames
Maybe.new
toMaybe.from_value
.
๐ Because all our other containers support this protocol.
OnlyMaybe
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
toApplicative
๐ฅ Breaking : changes
.from_io
and.from_failed_io
ofIOResult
to returnAny
instead ofNoReturn
unfilled type๐ฅ Breaking : removes
.lift
and.lift_*
methods from all containers,
usemap_
,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 withIO
andFuture
,
it enforces to write imperative code in a functional codebase.
๐ Useflow
insteadโ Adds typed
partial
andcurry
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
, andalt
pointfree functionsAdds typed
bind_result
,bind_io
,bind_ioresult
,
bind_context
,bind_context_result
,bind_future
,
bind_async
, andbind_awaitable
pointfree functionsAdds typed
bind_async_future
andbind_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 withasync
functionsโ Adds
FutureResult
container to easily work
withasync
function that might failโ Adds
RequiresContextFutureResult
containerโ Adds
ReaderFutureResult
alias forRequiresContextFutureResult
โ Adds
RequiresContextFutureResultE
andReaderFutureResultE
aliasesโ Adds
Future
,FutureResult
andRequiresContextFutureResult
๐ support for all existing pointfree functionsโ Adds
bind_io
method toIOResult
โ Adds
bind_io
method toRequiresContextIOResult
โ Adds
or_else
method toMaybe
Adds
.from_io
and.from_failed_io
toRequiresContextIOResult
Syncs naming in
from_*
methods, now all parameters are namedinner_value
โ Adds
not_
composition helperโ Adds
flatten
support forFuture
,
FutureResult
andRequiresContextFutureResult
Adds
__copy__
and__deepcopy__
magic methods toImmutable
classSpeeds 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 withNoDeps
where it is logically true๐ Bugfixes
- ๐ Fixes that
@safe
decorator was generating incorrect signatures
for functions withAny
- ๐ Fixes that
.rescue()
ofRequiresContextResult
was returningAny
- ๐ Fixes that
.rescue()
ofRequiresContextIOResult
was returningAny
- ๐ Fixes that
RequiresContextResult
andRequiresContextIOResult
were notfinal
- ๐ Fixes that
ImmutableStateError
was not a subclass ofAttributeError
- ๐ Fixes that
IOResult
was not showingstr
representation
of wrappedinner_value
Misc
- โ
Replaces
pytest-asyncio
withanyio
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?
-
v0.13.0 Changes
February 02, 2020Announcing article: https://sobolevn.me/2020/02/typed-functional-dependency-injection
๐ Features
๐ฅ Breaking : renames
join
toflatten
, sorry!๐ฅ Breaking : renames
box
tobind
and moves it toreturns.pointfree
๐ฅ Breaking : removes
Maybe.rescue
andMaybe.fix
methods๐ฅ Breaking : renames
io_squash
tosquash_io
๐ and moves it toreturns.converters
๐ฅ Breaking : moves all interfaces from
returns.primitives.container
to
returns.primitives.interfaces
โ Adds
rescue
pointfree functionโ Adds
ResultE
alias forResult[..., Exception]
โ Adds
RequiresContext
container andContext
helper classโ Adds
RequiresContext
support forbind
pointfree functionโ Adds
RequiresContext
support forflatten
functionโ Adds
RequiresContextResult
containerโ Adds
RequiresContextResultE
aliasโ Adds
ReaderResult
andReaderResultE
aliases
๐ป forRequiresContextResult[..., ..., Exception]
โ Adds
RequiresContextResult
support forbind
andrescue
โ Adds
RequiresContextResult
support forflatten
โ Adds
IOResult
helper to work better withIO[Result[a, b]]
โ Adds
IOResultE
alias forIOResult[a, Exception]
โ Adds
IOResult
support forbind
โ Adds
IOResult
support forflatten
โ Adds
IOResult
support for@pipeline
โ Adds
IOResult
support forcoalesce
โ Adds
IOResult
support foris_successful
โ Adds
RequiresContextIOResult
containerโ Adds
RequiresContextIOResultE
aliasโ Adds
ReaderIOResult
andReaderIOResultE
aliases
๐ป forRequiresContextIOResult[..., ..., Exception]
โ Adds
RequiresContextIOResult
support forbind
andrescue
โ Adds
RequiresContextIOResult
support forflatten
โ Adds
Result.lift
,Maybe.lift
,RequiresContext.lift
,
andRequiresContextResult.lift
functions in addition toIO.lift
โ Adds
Immutable
primitive typeAdds
Unitable
protocol and.from_success()
and.from_failure()
methods for allResult
realted classesโ Adds
Instanceable
protocol and.from_value()
method
forIO
andRequiresContext
โ Adds
flow
function, which is similar topipe
โ Adds
swap
coverter forResult
andIOResult
โ Adds
squash_context
function to squashRequiresContext
similar toIO
๐ Bugfixes
- Now
Success
andFailure
(bothio
and pure) returnAny
and notNoReturn
- ๐ Fixes how
flatten
works, also adds more tests and docs aboutFailure
case - ๐ Fixes
Unwrappable
type being parametrized with only oneTypeVar
- ๐ Changes
Success
andFailure
to returnAny
instead ofNoReturn
Misc
- โก๏ธ Updates
poetry
version intravis
- ๐ Imporves
pipe
docs withlambda
andGeneric
problem - ๐ Improves docs in several places
- โ Now examples in docs tries to be docstests where possible
- ๐ Changes how tests are checked with
mypy
in CI
- Now
-
v0.12.0 Changes
December 21, 2019๐ Features
- ๐ฅ Breaking : now
@pipeline
requires a container type when created:
@pipeline(Result)
or@pipeline(Maybe)
Maybe
andResult
now hassuccess_type
andfailure_type
aliases- โ Adds
Result.unify
utility method for better error type composition - ๐ We now support
dry-python/classes
as a first-class citizen - โ Adds
io_squash
to squash severalIO
containers into one container
with a tuple inside, currently works with9
containers max at a time - โ Adds
untap
function which does convert return type toNone
๐ Bugfixes
- ๐ Fixes that containers were not usable with
multiprocessing
- ๐ Changes the inheritance order, now
BaseContainer
is the first child - ๐ Fixes that
Nothing
had incorrect docstrings
Misc
- ๐ฆ Now
generated
package is protected - โก๏ธ Updates
poetry
to1.0
- ๐ฅ Breaking : now