package stored_reversed

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

Module Stored_reversedSource

Sourcetype +'a t

'a list t represents a list temporarily stored in the reverse of its logical order.

e.g. to represent the sequence 1 then 2 we may store 2 :: 1 :: []

Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.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
Sourceval empty : 'a list t

The empty list.

to_list empty == []

Sourceval snoc : 'a list t -> 'a -> 'a list t

/O(1)/. Add an item to the logical end of the list.

to_list (snoc xs x) == to_list xs @ [x]

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

/O(n)/. Convert from a list, preserving the logical order.

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

/O(n)/. Convert to a list, preserving the logical order.

Sourceval of_list_rev : 'a list -> 'a list t

/O(1)/ Convert from a list, reversing the logical order.

Sourceval to_list_rev : 'a list t -> 'a list

/O(1)/ Convert to a list, reversing the logical order.

Sourceval map_to_list : ?tail:'b list -> 'a list t -> f:('a -> 'b) -> 'b list

/O(n)/. Perform a map while converting to a list.

/O(n)/ where /n/ is the length of x.

map_to_list x ~f ~tail:y == List.map (to_list x) ~f @ y

The default ~tail is [].

Sourceval map_append : 'b list t -> 'a list -> f:('a -> 'b) -> 'b list t

/O(n)/ Map and append values from a list, preserving logical order.

/O(n)/ where /n/ is the length of y.

map_append x y ~f == List.fold (List.map y ~f) ~init:x ~f:snoc

include Core.Quickcheckable.S1 with type 'a t := 'a t
Sourcemodule Stable : sig ... end
OCaml

Innovation. Community. Security.