.. title:: AsyncIO lisa.monad.AsyncIO ================== .. autoclass:: lisa.monad::AsyncIO :no-members: :no-inherited-members: :no-undoc-members: :no-private-members: :no-special-members: .. rubric:: Attributes .. list-table:: :align: left * - :attr:`~lisa.monad.Async.__slots__` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Async .. rubric:: Properties .. list-table:: :align: left * - :attr:`~lisa.monad.Async.coro` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Async Coroutine that will only yield non-monadic values. All the monadic values will be processed by the monad transformer stack as expected and will stay hidden. * - :attr:`~lisa.monad.Async.x` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Async Run the coroutine to completion in its event loop. .. rubric:: Methods .. list-table:: :align: left * - :meth:`~lisa.monad.AsyncIO.bind` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Async Takes a monadic value Monad[A], a function that takes an A and returns Monad[B], and returns a Monad[B]. * - :meth:`~lisa.monad.Monad.__await__` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad._MonadBase * - :meth:`~lisa.monad.MonadTrans.do` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.MonadTrans Decorate a coroutine function so that ``awaits`` gains the powers of the monad. * - :meth:`~lisa.monad.Async.hoist` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Async Lift a monadic value ``m`` by one level in the stack, i.e.: Given a stack for 3 transformers ``T1(T2(T3(Identity)))``, a value ``m = T2(Identity).pure(42)``. we have ``T2.hoist(m, T3.pure) == T2(T3(Identity)).pure(42)``. * - :meth:`~lisa.monad.Monad.join` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Monad Takes a monadic value Monad[Monad[A]], and returns a Monad[A]. * - :meth:`~lisa.monad.Async.lift` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Async Lift a monadic value ``m`` by one level in the stack, i.e.: Given a stack for 3 transformers ``T1(T2(T3(Identity)))``, a value ``m = T3(Identity).pure(42)``. we have ``T2.lift(m) == T2(T3(Identity)).pure(42)``. * - :meth:`~lisa.monad.Monad.map` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.Monad Takes a monadic value Monad[A], a function that takes an A and returns B, and returns a Monad[B]. * - :meth:`~lisa.monad.MonadTrans.pure` :sup:`inherited` - .. withrefctx:: :module: lisa.monad :class: lisa.monad.MonadTrans Turn a regular value of type ``A`` into a monadic value of type ``Monad[A]``. Attributes ---------- .. autoattribute:: lisa.monad::AsyncIO.__slots__ Properties ---------- .. autoproperty:: lisa.monad::AsyncIO.coro .. autoproperty:: lisa.monad::AsyncIO.x Methods ------- .. automethod:: lisa.monad::AsyncIO.bind .. automethod:: lisa.monad::AsyncIO.__await__ .. automethod:: lisa.monad::AsyncIO.do .. automethod:: lisa.monad::AsyncIO.hoist .. automethod:: lisa.monad::AsyncIO.join .. automethod:: lisa.monad::AsyncIO.lift .. automethod:: lisa.monad::AsyncIO.map .. automethod:: lisa.monad::AsyncIO.pure