package inquire

  1. Overview
  2. Docs
An OCaml library to create beautiful interactive CLIs

Install

Dune Dependency

Authors

Maintainers

Sources

inquire-0.2.1.tbz
sha256=0b88d89e24d4cbc0560a7c8d8ec51388990e1b27f24685029997afa52a7c720f
sha512=8b62860a8d15e41528a404a6f1b9968c3d79755607b5ea319af2e3e45516e672a785361d278279910928db4054e1800e87bcee0210ff3eabfb330713b368c827

doc/inquire.zed/Zed_input/Make/index.html

Module Zed_input.MakeSource

Make (Event) makes a a new binder.

Parameters

Signature

Sourcetype event = Event.t

Type of events.

Sourcetype +'a t

Type of set of bindings mapping input sequence to values of type 'a.

Sourceval empty : 'a t

The empty set of bindings.

Sourceval add : event list -> 'a -> 'a t -> 'a t

add events x bindings binds events to x. It raises Invalid_argument if events is empty.

Sourceval remove : event list -> 'a t -> 'a t

remove events bindings unbinds events. It raises Invalid_argument if events is empty.

Sourceval fold : (event list -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b

fold f set acc executes f on all sequence of set, accumulating a value.

Sourceval bindings : 'a t -> (event list * 'a) list

bindings set returns all bindings of set.

Sourcetype 'a resolver

Type of a resolver. A resolver is used to resolve an input sequence, i.e. to find the value associated to one. It returns a value of type 'a when a matching sequence is found.

Sourcetype 'a pack

A pack is a pair of a set of bindings and a mapping function.

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

pack f set creates a pack.

Sourceval resolver : 'a pack list -> 'a resolver

resolver packs creates a resolver from a list of pack.

Sourcetype 'a result =
  1. | Accepted of 'a
    (*

    The sequence is terminated and associated to the given value.

    *)
  2. | Continue of 'a resolver
    (*

    The sequence is not terminated.

    *)
  3. | Rejected
    (*

    None of the sequences is prefixed by the one.

    *)

Result of a resolving operation.

Sourceval resolve : event -> 'a resolver -> 'a result

resolve event resolver tries to resolve event using resolver.

OCaml

Innovation. Community. Security.