bwd
Backward lists
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
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
Comparison
Iterators
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
Iterators on two lists
Note that the iteration direction is from the right to the left, in the opposite direction of the corresponding functions in ListLabels
.
List scanning
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
List searching
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
Lists of pairs
Backward and forward lists
val to_list : 'a bwd -> 'a list
val of_list : 'a list -> 'a bwd
Infix notation
module Infix : sig ... end
Notation inspired by Conor McBride.