package eio

  1. Overview
  2. Docs
Effect-based direct-style IO API for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

eio-1.2.tbz
sha256=3792e912bd8d494bb2e38f73081825e4d212b1970cf2c1f1b2966caa9fd6bc40
sha512=4a80dbcf8cf2663bdad0f2970871844f37bd293c56bd1ce602910e0a613754945f1f942719f9630906453be7c73c1732dc97526c6c90b0b36100d04fd5e871e4

doc/eio.mock/Eio_mock/Action/index.html

Module Eio_mock.ActionSource

Actions that can be performed by mock handlers.

Sourcetype 'a t = [
  1. | `Return of 'a
    (*

    Immediately return a value

    *)
  2. | `Raise of exn
    (*

    Raise an exception

    *)
  3. | `Await of 'a Eio.Promise.or_exn
    (*

    Wait for a promise to resolve

    *)
  4. | `Yield_then of 'a t
    (*

    Call Eio.Fiber.yield, then perform an action

    *)
  5. | `Run of unit -> 'a
    (*

    Run any code you like.

    *)
]
Sourceval run : 'a t -> 'a

run t performs action t and returns the result.

Sourceval map : ('a -> 'b) -> 'a t -> 'b t

run (map f t) = f (run t).

OCaml

Innovation. Community. Security.