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.lambda-term/LTerm_dlist/index.html

Module LTerm_dlistSource

Mutable sequence of elements (deprecated)

A sequence is an object holding a list of elements which support the following operations:

  • adding an element to the left or the right in time and space O(1)
  • taking an element from the left or the right in time and space O(1)
  • removing a previously added element from a sequence in time and space O(1)
  • removing an element while the sequence is being transversed.
  • deprecated

    This module should be an internal implementation detail of Lwt, and may be removed from the API at some point in the future. Use any other doubly-linked list library as an alternative.

Sourcetype 'a t

Type of a sequence holding values of type 'a

Sourcetype 'a node

Type of a node holding one value of type 'a in a sequence

Operation on nodes

Sourceval remove : 'a node -> unit

Removes a node from the sequence it is part of. It does nothing if the node has already been removed.

Operations on sequence

Sourceval create : unit -> 'a t

create () creates a new empty sequence

Sourceval add_l : 'a -> 'a t -> 'a node

add_l x s adds x to the left of the sequence s

Sequence iterators

Note: it is OK to remove a node while traversing a sequence

Sourceval iter_l : ('a -> unit) -> 'a t -> unit

iter_l f s applies f on all elements of s starting from the left

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

fold_l f s is:

  fold_l f s x = f en (... (f e2 (f e1 x)))

where e1, e2, ..., en are the elements of s

OCaml

Innovation. Community. Security.