Library
Module
Module type
Parameter
Class
Class type
This module is similar to ListLabels
but for backward lists.
Notes on the discrepancies with ListLabels
:
rev
, rev_append
, rev_map
, and rev_map2
will never be included.prepend
was added as the forward version of append
.Notation
was added for the infix notation.init
, tl
(as hd
for lists), hd
(as tl
for lists), merge
, to_seq
, and of_seq
are also missing, but might be added in the future.Please open a GitHub issue if you want a function to be included. We want to make this library useful to you, too!
val length : 'a bwd -> int
val compare_length_with : 'a bwd -> len:int -> int
val nth : 'a bwd -> int -> 'a
val nth_opt : 'a bwd -> int -> 'a option
val prepend : 'a bwd -> 'a list -> 'a list
Note that the iteration direction is from the right to the left, in the opposite direction of the corresponding functions in ListLabels
.
val iter : f:('a -> unit) -> 'a bwd -> unit
val iteri : f:(int -> 'a -> unit) -> 'a bwd -> unit
val fold_left : f:('a -> 'b -> 'a) -> init:'a -> 'b bwd -> 'a
val fold_right : f:('a -> 'b -> 'b) -> 'a bwd -> init:'b -> 'b
Note that the iteration direction is from the right to the left, in the opposite direction of the corresponding functions in ListLabels
.
Note that the iteration direction is from the right to the left, in the opposite direction of the corresponding functions in ListLabels
.
val for_all : f:('a -> bool) -> 'a bwd -> bool
val exists : f:('a -> bool) -> 'a bwd -> bool
val mem : 'a -> set:'a bwd -> bool
val memq : 'a -> set:'a bwd -> bool
Note that the iteration direction is from the right to the left, in the opposite direction of the corresponding functions in ListLabels
.
val find : f:('a -> bool) -> 'a bwd -> 'a
val find_opt : f:('a -> bool) -> 'a bwd -> 'a option
val find_map : f:('a -> 'b option) -> 'a bwd -> 'b option
val to_list : 'a bwd -> 'a list
val of_list : 'a list -> 'a bwd
module Infix : sig ... end
Notation inspired by Conor McBride.