package bonsai

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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.