Commit graph

1635 commits

Author SHA1 Message Date
Simon Cruanes
c5d435848b
improve test for CCByte_buffer 2022-02-08 13:07:51 -05:00
Simon Cruanes
826381690c
add random test to CCByte_buffer 2022-02-08 13:07:51 -05:00
Simon Cruanes
d7214345e5
update doc and aliases 2022-02-08 13:07:51 -05:00
Simon Cruanes
b42b1f4907
fix: rename size to cap in CCByte_buffer 2022-02-08 13:07:50 -05:00
Simon Cruanes
5f064dbbbf
feat: add Byte_buf, a byte buffer. 2022-02-08 13:07:50 -05:00
Simon Cruanes
21c10d2ad4
less aggressive constant.
series of sizes should now be:

```
 # let next n = n + n lsr 1 + 2;;
 # CCSeq.unfold (fun x -> Some (x, next x)) 0 |> CCSeq.take 20 |> CCSeq.to_list;;
- : int list =
[0; 2; 5; 9; 15; 24; 38; 59; 90; 137; 207; 312; 470; 707; 1062; 1595; 2394;
 3593; 5391; 8088]
 ```
2022-02-03 19:15:13 -05:00
Simon Cruanes
02c0953468
fix stupid typo 2022-02-03 19:13:43 -05:00
Simon Cruanes
0baa4fddec
perf(vector): inline some more stuff plz 2022-02-03 18:55:50 -05:00
Simon Cruanes
8c9d7016b8
perf: uniformize ocamlopt_flags
we don't need codegen which depends on >= 4.03, it's assumed. Also
include a reasonable value for `-inline` when flambda isn't available.
2022-02-03 18:54:59 -05:00
Simon Cruanes
7ec9e50f74
perf: make sure to use some decent level of inlining even without flambda 2022-02-03 18:51:09 -05:00
Simon Cruanes
f540a6d7e5
perf(vector): less aggressive growth for internal resizing 2022-02-03 18:50:32 -05:00
Simon Cruanes
2d30b2ae14
add CCSeq.{zip_i,of_string} 2022-01-27 13:48:49 -05:00
Simon Cruanes
e25b9fc9b4
fix @since in CCSeq 2022-01-27 13:45:01 -05:00
Ewen Maclean
4e79b72306
adding opt_map to simplify result function application over optionals (#397)
adding `Result.opt_map` to simplify result function application over optionals
2022-01-25 15:05:11 -05:00
Simon Cruanes
3960ea3792
feat(BV): add set_bool 2022-01-02 21:58:45 -05:00
Simon Cruanes
3d57a5c86e
feat(CCBV): prevent resize from shrinking underlying array
also add `BV.resize_minimize_memory` to force shrinking. This shouldn't
be the default because it can allocate a lot in case of repeated
shrinkings.
2022-01-02 21:57:53 -05:00
Simon Cruanes
92463d33c5
perf(BV): make more functions inline, use raise_notrace 2022-01-02 21:56:33 -05:00
Simon Cruanes
ced66a76e1
perf(CCBV): better bitwise operations
- a 8-bit popcount
- simpler logic for LSB masks
2022-01-02 21:45:26 -05:00
Simon Cruanes
b8c93f42fa
feat(CCInt32): add popcount function 2022-01-02 21:44:05 -05:00
Simon Cruanes
22bbe23c5a
feat(CCInt64): add popcount operation
adapted from CCInt, but directly on int64, so it works for
Int64.{min_int/max_int}.
2022-01-02 21:17:18 -05:00
Simon Cruanes
569e254540
fix: use == 2022-01-02 12:15:31 -05:00
Simon Cruanes
64ecd0c3ba
add shims for Atomic and Unit 2022-01-02 12:08:16 -05:00
Simon Cruanes
4e0f35c078
make fun shims inline 2021-12-22 11:00:33 -05:00
Simon Cruanes
a127e139ae
doc for CCParse
close #392
2021-12-16 13:17:09 -05:00
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
Simon Cruanes
16bea66073
more warnings 2021-12-02 11:48:57 -05:00
Simon Cruanes
cea6647c3c
fix warnigns for CCOption 2021-12-02 11:46:41 -05:00
Simon Cruanes
bee23722ea
fix: use labels in CCParse 2021-12-02 11:38:22 -05:00
Simon Cruanes
9123f7907f
feat(ccparse): expose pos to get current pos; improve perf
perf of obtaining many positions is now better because we cache line
offsets, which means computing a line,col pair is just a O(ln n) bisect
away.
2021-12-01 16:05:20 -05:00
Fardale
c33477c397 chore: remove unwanted comment 2021-11-12 17:38:37 +01:00
Fardale
a5822f7273 doc: inline the doc of CCShim*_ module in the doc 2021-11-12 17:34:06 +01:00
Fardale
099f2e176f chore(doc): adapt module docstring for the index page 2021-11-11 14:40:35 +01:00
Simon Cruanes
2100a0a0fb
fix: rely on either compatibility library 2021-10-24 22:56:36 -04:00
Simon Cruanes
2c2fa5d008
fix asymptotic behavior of resize functions 2021-10-21 11:07:11 -04:00
Simon Cruanes
e6e07ba4da
fix tests and implem for CCVector 2021-10-21 10:59:03 -04:00
Dario Pinto
d1ddeeb31f
add CCVector.resize_with and CCVector.resize_with_init, tests and doc (#389)
add CCVector.resize_with and CCVector.resize_with_init, tests and doc
2021-10-21 10:57:23 -04:00
Simon Cruanes
541d716d5c
in CCVector, use invalid_arg, and document it 2021-10-20 10:47:06 -04:00
Simon Cruanes
7288045828
more doc for CCVector 2021-10-19 09:34:45 -04:00
Simon Cruanes
b2cff1d0b7
prepare for 3.6 2021-10-18 22:31:44 -04:00
Simon Cruanes
bf15e88f0c
fix doc 2021-09-25 20:58:31 -04:00
Simon Cruanes
ff2d1d3cbc
Merge pull request #380 from c-cube/wip-parse-2021-05-04
refactor `CCParse` to make it easier to use
2021-09-25 20:57:26 -04:00
Simon Cruanes
9c72797515
minor changes 2021-09-25 20:51:18 -04:00
Simon Cruanes
938c7cb90a
more doc 2021-09-25 20:50:04 -04:00
Simon Cruanes
b8fa400465
a test to ensure chars1_if p = take1_if p >|= Slice.to_string 2021-09-25 20:48:23 -04:00
Simon Cruanes
e06cd516f0
detail 2021-09-25 15:38:35 -04:00
Simon Cruanes
396a7db967
more fixes 2021-09-24 22:58:08 -04:00
Simon Cruanes
8f9ecf5f41
some fixes related to review 2021-09-24 22:45:17 -04:00
Simon Cruanes
ac1baae839
add missing @since 2021-09-24 14:37:36 -04:00
Simon Cruanes
16576e8838
Update src/core/CCOpt.mli 2021-09-24 14:36:53 -04:00
Fardale
302dba6cb5 chore(CCOption): rename CCOpt to CCOption and deprecate CCOpt
In the stdlib the module associated with the option type is called
Option and in containers it was called CCOpt. Renaming CCOpt to CCOption
make the name of containers module uniforme with respect to the stdlib.
2021-09-22 23:07:05 +02:00