package gen
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Iterators for OCaml, both restartable and consumable
Install
dune-project
Dependency
Authors
Maintainers
Sources
v1.1.tar.gz
md5=fa8066511b693815fe659fd022f4c6bc
sha512=71a4b5c3666a7c11935398a78feea7383f61d2c549dfb96e324d40783ffa87b5ec492c5ec468803aabfb9b48e7d0ebaa30b24d2b974540afc7cca5feea3121c1
doc/gen/GenClone/index.html
Module GenCloneSource
Clonable Generators
Utils to save the internal state of a generator, and restart from this state. This will and should not work on any iterator, but for some of them (e.g. reading from a file, see IO) it makes a lot of sense.
A generator that can be cloned as many times as required.
Prepend method
Misc
Low-level Persistency
Example:
let g = 1 -- 1000 ;;
val g : int t = <fun>
let c = g |> MList.of_gen_lazy |> MList.to_clonable;;
val c : int clonable = <obj>
c#next |> take 500 |> to_list;;
- : int list = [1; 2; 3; .....; 500]
let c' = c#clone ;;
val c' : int clonable = <obj>
c |> to_list;;
- : int list = [501; 502; ....; 1000]
c'#gen |> to_list;; (* c consumed, but not c' *)
- : int list = [501; 502; ....; 1000]
c#gen |> to_list;;
- : int list = []IO
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page