package eio

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

Install

Dune Dependency

Authors

Maintainers

Sources

eio-0.7.tbz
sha256=675e67f343ccf37b965d15d1ee1c639d7a06431e8f08e95559133419f3488ee1
sha512=3d1bd0e5e0aa79d8858d83944d734a0efc325ed66a12a1506c3b36281db56c0216e6cb90a46e6021db1ea34cdd2567ebabe0bd687d9989495bb7cf6099e90ba7

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.