ocaml-containers/src
Shon Feder 946ac4e05d
Make CCSeq.to_array behave better with stateful sequences (#390)
Make Seq.to_array only traverse seq once

This PR suggests a change to `Seq.to_array`, which uses construction of
an intermediate list to prevent traversing the Seq twice. This requires
the allocation of an intermediate list, but it eliminates the surprising
behavior that otherwise occurs with state-full sequences, due to the
extra traversal required to obtain the length of the sequence. E.g.,
with the previous implementation, the value of `to_array` for the
sequence constructed in the test added in this commit is `[|4;5;6|]`,
while `to_list` gives `[|1;2;3|]`.
2021-12-11 21:28:10 -05:00
..
codegen doc: more docs for codegen 2021-04-03 18:54:07 -04:00
core Make CCSeq.to_array behave better with stateful sequences (#390) 2021-12-11 21:28:10 -05:00
data chore(doc): adapt module docstring for the index page 2021-11-11 14:40:35 +01:00
monomorphic Substitute 'Pervasives' with 'Stdlib' 2020-03-24 10:43:49 -04:00
threads refactor(pool): less locking, fix deadlock, more parallelism 2021-03-28 18:15:45 -04:00
top breaking: move CCSexp into the core library, delete containers.sexp 2020-04-24 19:13:54 -04:00
unix fix typo 2020-03-06 08:37:02 -06:00
dune ci: try to test on mac OS again, amend tests, make mdx optional 2020-07-30 19:12:49 -04:00
mdx_runner.ml try to fix tests that fail on mac OS 2020-07-31 15:29:49 -04:00
mkflags.ml chore: update dune to use dune-config 2018-08-15 13:38:58 -05:00