Skip to content

Commit f295d2d

Browse files
committed
Working on docs
1 parent f50121b commit f295d2d

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

docs/pages/context.rst

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,46 @@ Which means that it is a wrapper around pure function that might fail.
264264
We also added a lot of useful methods for this container,
265265
so you can work easily with it:
266266

267-
- :meth:`returns.context.requires_context.RequiresContextResult.from_typecast`
267+
.. currentmodule:: returns.context.requires_context_result
268+
269+
- :meth:`~RequiresContextResult.from_typecast`
268270
turns accidental ``RequiresContext[env, Result[a, b]]`` into
269271
full-featured ``RequiresContextResult[env, a, b]``
270-
- :meth:`returns.context.requires_context.RequiresContextResult.bind_result`
272+
- :meth:`~RequiresContextResult.bind_result`
271273
allows to bind functions that return ``Result`` with just one call
272-
- :meth:returns.context.requires_context.RequiresContextResult.bind_context`
274+
- :meth:`~RequiresContextResult.bind_context`
273275
allows to bind functions that return ``RequiresContext`` easily
274276
- There are also several useful contructors from any possible type
275277

276278
Use it when you work with pure context-related functions that might fail.
277279

278280

281+
RequiresContextIOResult container
282+
---------------------------------
283+
284+
This container is a combintaion of ``RequiresContext[env, IOResult[a, b]]``.
285+
Which means that it is a wrapper around impure function that might fail.
286+
287+
We also added a lot of useful methods for this container,
288+
so you can work easily with it:
289+
290+
.. currentmodule:: returns.context.requires_context_io_result
291+
292+
- :meth:`~RequiresContextIOResult.from_typecast`
293+
turns accidental ``RequiresContext[env, IOResult[a, b]]`` into
294+
full-featured ``RequiresContextIOResult[env, a, b]``
295+
- :meth:`~RequiresContextIOResult.bind_result`
296+
allows to bind functions that return ``Result`` with just one call
297+
- :meth:`~RequiresContextIOResult.bind_ioresult`
298+
allows to bind functions that return ``IOResult`` with just one call
299+
- :meth:`~RequiresContextIOResult.bind_context`
300+
allows to bind functions that return ``RequiresContext`` easily
301+
- There are also several useful contructors from any possible type
302+
303+
Use it when you work with impure context-related functions that might fail.
304+
This is basically **the main type** that is going to be used in most apps.
305+
306+
279307
FAQ
280308
---
281309

@@ -384,7 +412,7 @@ RequiresContextResult
384412
:members:
385413

386414
RequiresContextIOResult
387-
~~~~~~~~~~~~~~~~~~~~~
415+
~~~~~~~~~~~~~~~~~~~~~~~
388416

389417
.. autoclasstree:: returns.context.requires_context_io_result
390418

0 commit comments

Comments
 (0)