package stored_reversed
A library for representing a list temporarily stored in reverse order.
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=fb312757d8e1d9fb9fb757705bcdeee667f541305abc02eaef47a6fa548e8522
doc/stored_reversed/Stored_reversed/index.html
Module Stored_reversed
Source
'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 :: []
/O(1)/. Add an item to the logical end of the list.
to_list (snoc xs x) == to_list xs @ [x]
/O(1)/ Convert from a list, reversing the logical order.
/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 []
.
/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
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>