package bonsai

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.15.1.tar.gz
sha256=0c4a714146073f421f1a6179561f836b45d8dc012c743207d3481ea63bef74bf

doc/bonsai.focus_ring/Focus_ring/index.html

Module Focus_ringSource

A simple data structure for keeping track of a focused element within a list. The focus wraps around so that calling prev when the focus is the head of the list will cause the focus to move to the end. There is always a focused element -- i.e. there is no blur operation.

Sourcetype 'a t
include Ppx_compare_lib.Comparable.S1 with type 'a t := 'a t
Sourceval compare : 'a Base__Ppx_compare_lib.compare -> 'a t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
Sourceval equal : 'a Base__Ppx_compare_lib.equal -> 'a t Base__Ppx_compare_lib.equal
include Sexplib0.Sexpable.S1 with type 'a t := 'a t
Sourceval t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
Sourceval of_nonempty_list_exn : 'a list -> 'a t
Sourceval next : 'a t -> 'a t
Sourceval prev : 'a t -> 'a t
Sourceval current_focus : 'a t -> 'a
Sourceval set : 'a t -> f:('a -> bool) -> 'a t option

O(n). Find the first element matching f in the list, and make that the focus.

OCaml

Innovation. Community. Security.