package bwd

  1. Overview
  2. Docs

Module Bwd.BwdLabelsSource

This module mimics a small part of the Stdlib.ListLabels module.

Sourcetype 'a t = 'a bwd =
  1. | Emp
  2. | Snoc of 'a t * 'a
Sourceval length : 'a t -> int
Sourceval snoc : 'a t -> 'a -> 'a t
Sourceval nth : 'a t -> int -> 'a
Sourceval nth_opt : 'a t -> int -> 'a option
Sourceval append : 'a t -> 'a list -> 'a t
Sourceval prepend : 'a t -> 'a list -> 'a list

Comparison

Sourceval equal : eq:('a -> 'a -> bool) -> 'a t -> 'a t -> bool
Sourceval compare : cmp:('a -> 'a -> int) -> 'a t -> 'a t -> int

Iterators

Sourceval iter : f:('a -> unit) -> 'a t -> unit
Sourceval map : f:('a -> 'b) -> 'a t -> 'b t
Sourceval mapi : f:(int -> 'a -> 'b) -> 'a t -> 'b t
Sourceval filter_map : f:('a -> 'b option) -> 'a t -> 'b t
Sourceval concat_map : f:('a -> 'b list) -> 'a t -> 'b t
  • deprecated This function is ill-designed and will be removed or changed in the next major release.
Sourceval fold_left : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'a
Sourceval fold_right : f:('a -> 'b -> 'b) -> 'a t -> init:'b -> 'b

Iterators on two lists

Sourceval fold_right2 : f:('a -> 'b -> 'c -> 'c) -> 'a t -> 'b t -> init:'c -> 'c

List scanning

Sourceval for_all : f:('a -> bool) -> 'a t -> bool
Sourceval exists : f:('a -> bool) -> 'a t -> bool
Sourceval mem : 'a -> set:'a t -> bool

List searching

Sourceval filter : f:('a -> bool) -> 'a t -> 'a t

Backward and forward lists

Sourceval to_list : 'a t -> 'a list
Sourceval of_list : 'a list -> 'a t