Skip to content

Commit 240b9e0

Browse files
committed
Almost done
1 parent 579e1d1 commit 240b9e0

File tree

16 files changed

+254
-103
lines changed

16 files changed

+254
-103
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ See (0Ver)[https://0ver.org/].
2929

3030
### Bugfixes
3131

32+
- Now `Success` and `Failure` (both `io` and pure) return `Any` and not `NoReturn`
3233
- Fixes how `flatten` works, also adds more tests and docs about `Failure` case
3334
- Fixes `Unwrappable` type being parametrized with only one `TypeVar`
3435

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Contents
2424
:caption: Containers
2525

2626
pages/maybe.rst
27+
pages/result.rst
2728
pages/context.rst
2829
pages/io.rst
29-
pages/result.rst
3030

3131
.. toctree::
3232
:maxdepth: 2

docs/pages/container.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Basics
2424

2525
The main idea behind a container is that it wraps some internal state.
2626
That's what
27-
:py:attr:`._inner_value <returns.primitives.container.Container._inner_value>`
27+
:attr:`._inner_value <returns.primitives.container.Container._inner_value>`
2828
is used for.
2929

3030
And we have several functions
@@ -153,27 +153,27 @@ Composition
153153
-----------
154154

155155
You can and should compose different containers together.
156-
Here's the full table of compositions that make sense:
157-
158-
Ok
159-
~~
160-
161-
- ``IO[Result[A, B]]`` ✅
162-
- ``IO[Maybe[A]]`` ✅
156+
Here's a table of some compositions that do not make sense:
163157

164158
Needs transformation
165159
~~~~~~~~~~~~~~~~~~~~
166160

161+
- ``IO[Result[A, B]]`` 🤔,
162+
use :meth:`returns.io.IOResult.from_typecast` and ``IOResult``
163+
- ``IO[Maybe[A]]`` 🤔,
164+
use :func:`maybe_to_result <returns.converters.maybe_to_result>`
165+
and then :meth:`returns.io.IOResult.from_typecast`
166+
to convert it to ``IOResult``
167167
- ``IO[IO[A]]`` 🤔, use :func:`flatten <returns.converters.flatten>`
168168
- ``Maybe[Maybe[A]]`` 🤔, use :func:`flatten <returns.converters.flatten>`
169169
- ``Result[Result[A, B], C]`` 🤔,
170-
use :func:`flatten <returns.converters.flatten>`
170+
use :func:`flatten <returns.converters.flatten>`
171171
- ``Result[Maybe[A], B]`` 🤔,
172-
use :func:`maybe_to_result <returns.converters.maybe_to_result>`
173-
and then :func:`flatten <returns.converters.flatten>`
172+
use :func:`maybe_to_result <returns.converters.maybe_to_result>`
173+
and then :func:`flatten <returns.converters.flatten>`
174174
- ``Maybe[Result[A, B]]`` 🤔,
175-
use :func:`result_to_maybe <returns.converters.result_to_maybe>`
176-
and then :func:`flatten <returns.converters.flatten>`
175+
use :func:`result_to_maybe <returns.converters.result_to_maybe>`
176+
and then :func:`flatten <returns.converters.flatten>`
177177

178178
Nope
179179
~~~~
@@ -183,6 +183,7 @@ Nope
183183
- ``Result[A, Maybe[B]]`` 🚫
184184
- ``Result[A, Result[B, C]]`` 🚫
185185
- ``Maybe[IO[A]]`` 🚫
186+
- ``RequiresContext[IO[A], B]`` 🚫
186187

187188
You can use :ref:`converters` to convert ``Maybe`` and ``Result`` containers.
188189
You can also use :func:`flatten <returns.converters.flatten>`

0 commit comments

Comments
 (0)