package miaou-core

  1. Overview
  2. Docs
Miaou core/widgets (no drivers, no SDL)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6

doc/miaou-core.core/Miaou_core/Capability/index.html

Module Miaou_core.CapabilitySource

include module type of Miaou_interfaces.Capability

Typed capability keys and registry.

Sourcetype 'a key
Sourceval create : name:string -> 'a key

Create a fresh, globally unique key. name is for diagnostics.

Sourceval set : 'a key -> 'a -> unit

Register a capability implementation for a key. Overwrites existing.

Sourceval register : 'a key -> 'a -> unit

Alias for set.

Sourceval get : 'a key -> 'a option

Retrieve a registered implementation, if any.

Sourceval require : 'a key -> 'a

Retrieve or fail with a clear message (use during init for fail-fast).

Sourceval mem : 'a key -> bool

Whether a key has an implementation.

Sourceval clear : unit -> unit

Reset the registry (tests).

Sourceval list : unit -> (string * bool) list

List registered keys (name, present?).

Sourcetype any =
  1. | Any : 'a key -> any

Existential key for validation helpers.

Sourceval any : 'a key -> any

Pack a key as an existential.

Sourceval check_all : any list -> string list

Check that a set of capabilities is registered; returns names missing.