Skip to content

Commit ec13294

Browse files
committed
Some progress
1 parent 78ea691 commit ec13294

File tree

10 files changed

+664
-90
lines changed

10 files changed

+664
-90
lines changed

docs/pages/context.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,18 @@ And now we access the current context from any place in our callstack.
249249
Isn't it convenient?
250250

251251

252+
FAQ
253+
---
254+
255+
Why do I have to use explicit type annotation for ask method?
256+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257+
258+
How to create unit objects?
259+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
260+
261+
262+
263+
252264
Further reading
253265
---------------
254266

returns/_generated/flatten.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def _flatten(container):
1515
>>> from returns.maybe import Some
1616
>>> from returns.result import Failure, Success
1717
>>> from returns.io import IO, IOSuccess, IOFailure
18-
>>> from returns.context import Context
18+
>>> from returns.context import RequiresContext
1919
2020
>>> assert flatten(IO(IO(1))) == IO(1)
2121
@@ -28,8 +28,8 @@ def _flatten(container):
2828
>>> assert flatten(IOFailure(IOFailure(1))) == IOFailure(IOFailure(1))
2929
3030
>>> assert flatten(
31-
... Context.unit(Context.unit(1)),
32-
... )(Context.Empty) == 1
31+
... RequiresContext.from_value(RequiresContext.from_value(1)),
32+
... )(RequiresContext.empty) == 1
3333
3434
See also:
3535
https://bit.ly/2sIviUr

0 commit comments

Comments
 (0)