Parameter Make.IO

type 'a t
type file
type error
type lock
type notifier
val return : 'a -> 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val catch : (unit -> 'a t) -> (exn -> 'a t) -> 'a t
val async : (unit -> unit t) -> unit

Start one owned worker. Its failure must remain observable by catch and it must remain alive independently of the constructing callback.

val create_lock : unit -> lock
val with_lock : lock -> (unit -> 'a) -> 'a

Execute a short synchronous critical section and release the lock after normal return or exception. The callback performs no effects.

val create_notifier : unit -> notifier
val await : notifier -> unit t
val notify : notifier -> unit
val dispose : notifier -> unit

A thread-safe scheduler wakeup. notify resolves current waiters and may coalesce repeated notifications. dispose resolves current and future waits and releases runtime resources.

val child : dir:string -> name:string -> string
val ensure_directory : string -> (unit, error) Stdlib.result t
val open_append : string -> (file, error) Stdlib.result t
val write : file -> string -> offset:int -> length:int -> (int, error) Stdlib.result t

Write from the requested byte slice. Success returns a count in 0..length; the portable state machine resumes partial writes and rejects zero progress. The implementation must not retain the string after the returned effect settles; delivery may reuse its private backing storage for a later write.

val flush : file -> (unit, error) Stdlib.result t

Complete runtime buffering only. This need not provide fsync or crash durability.

val close : file -> (unit, error) Stdlib.result t
val pp_error : Stdlib.Format.formatter -> error -> unit