package sek
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
An efficient implementation of ephemeral and persistent sequences
Install
dune-project
Dependency
Authors
Maintainers
Sources
archive.tar.gz
md5=56c31c65f3b0431943218f58d0ebda99
sha512=dfe7886d046c119780a196e17ac7efa8e989bcef3743f01d08d9aabc871fdc6b59d16b7445d01b30d3eb1bf4addca6c46e283065ff207ff4354a2ce6af245be7
doc/CHANGES.html
Changes
2026/06/19
- Random access into a chunk has been optimized in the special case where this chunk is recursively full (which means that this chunk has no free slot and, if its elements are chunks, then they too are recursively full). (See commit
f3d39d9df6b45d726a95bb88d88125c381edc4d8.) This can speed up some operations (get,drop,take,split,reach) by up to 4x. - Concatenation has been optimized so as to achieve better worst-case time complexity. In practice, on the concatenation of persistent sequences of length one hundred or more, we observe a speedup of 10% to 30%. On the concatenation of ephemeral sequences, we observe no significant difference below length one million, and a possible slowdown of up to 30% beyond this length.
- Documentation: the time complexity claims of several operations were incorrect; they have been simplified and (hopefully) corrected.
2020/10/12
- In principle, when the parameter
check_iterator_validityistrue, a concurrent modification (that is, a modification of an ephemeral sequence that takes place while an iteration on this sequence is ongoing) must be detected bySek, giving rise to an exception. In several functions, this was not the case. Fixed. (These functions areE.to_seq,E.to_seqi,E.map,E.mapi,E.iter2_segments,E.iter2,E.map2,E.fold_left2,E.fold_right2,E.find2,E.exists2,E.for_all2,E.equal,E.compare,E.merge.)
2020/06/18
- The time complexity of every operation is now documented as part of its specification.
- New submodules
E.IterandP.Iter, which offer very efficient iterators over ephemeral and persistent sequences. - New functions
take,drop,sub,iter_segments,to_seq,of_list_segment,of_list,of_seq_segment,of_seq,find,find_opt,find_map,for_all,exists,mem,memq,map,mapi,rev,zip,unzip,filter,filter_map,partition,flatten,flatten_map,iter2,iter2_segments,fold_left2,fold_right2,map2,for_all2,exists2,equal,compare,sort,stable_sort,uniq,merge, in ephemeral and persistent flavors. - New functions
E.fillandE.blit. - New function
otherof typeside -> side. - New function
oppositeof typedirection -> direction. - New functor
SupplyDefault, which allows supplying a default element once and for all so as to obtain a simpler API. Unfortunately, this requires choosing a fixed type of elements at the same time. - New submodules
Emulated.ArrayandEmulated.List, which can be used as drop-in replacements for OCaml's standardArrayandListmodules. - New submodule
Segment, which offers a few facilities for iterating over array segments. - Breaking change: the default behavior of
E.copyis now to produce a disjoint sequence in timeO(n). The previous behavior, which exploits sharing and produces a result in timeO(K), is obtained by invokingE.copy ~mode:`Share. The two copying modes have the same observable behavior; they differ only in their performance characteristics. - Breaking change: the submodules
QueueandStackare renamedEmulated.QueueandEmulated.Stack. This makes it easier to avoid unintended shadowing ofStdlib.Queue,Stdlib.Stack, etc. It is now safe to useopen Sek. - Breaking change: the functor
Makenow takes just one structure as a parameter, instead of several structures. This is more pleasant and should make future evolution easier.
2020/04/03
- Initial release of the library.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page