Commit graph

78 commits

Author SHA1 Message Date
Simon Cruanes
40189757ca
Merge pull request #401 from c-cube/experiment-preproc
custom preprocessor rather than shim modules
2022-02-22 23:15:56 -05:00
Simon Cruanes
b837509de9
remove many more shims 2022-02-21 21:52:06 -05:00
Yotam Barnoy
408c14fac7
CCVector.insert: check if there's a need to blit
Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
2022-02-21 18:50:19 +02:00
Yotam Barnoy
9bb280e353 CCVector: add insert 2022-02-21 18:42:16 +02: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
f540a6d7e5
perf(vector): less aggressive growth for internal resizing 2022-02-03 18:50:32 -05: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
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
Simon Cruanes
1b87075284 fix test for multicore 2021-08-02 13:32:09 -04:00
Fardale
01da25cead break: change pp functions to take unit printer for sep/stop/start
sep/stop/start -> pp_sep/pp_stop/pp_start
string -> unit printer
2020-07-27 22:57:29 -04:00
Fardale
c85c135157 break: remove klist type and functions from core 2020-07-23 16:32:52 +02:00
Fardale
8c3d716ab1 break: rename fonction from *std_seq* to *seq* 2020-07-23 16:32:52 +02:00
Fardale
20234cdd22 fix(CCVector): rename shrink into truncate 2020-06-30 09:02:52 -05:00
Fardale
2faa3fbae5 chore(CCVector): rename remove to remove_and_shift 2020-04-28 08:53:35 -05:00
Fardale
c8d61a1248 feat(CCVector): add remove
remove keep the order of the element but need to move
all element after the removed one.
2020-04-28 08:53:35 -05:00
Fardale
c1461940c2 wip(3.0): rename CCVector.remove to CCVector.remove_unordered 2020-04-28 08:53:35 -05:00
Simon Cruanes
a767e4618d wip(3.0): remove deprecated functions, in particular sequence 2020-04-24 20:16:53 -04:00
Fardale
2b5f2fce11 feat(CCVector): add filter_in_place, deprecate filter' 2020-01-08 23:17:53 +01:00
Simon Cruanes
138047ef11 feat: add {to,of,add}_{iter,std_seq} where relevant; deprecations
deprecate `seq` named functions (for `iter`)
deprecate klist functions (for `std_seq`)

close #231
2019-12-14 16:29:07 -06:00
Fardale
27eb874523 CCVector: resize_ take the elt as argument
It is safer to have the check on the size of the underlying array
close to access of the first element.
2019-12-14 13:44:57 -06:00
Simon Cruanes
bf0227d404 feat: on 4.08, support let operators
close #276
2019-12-14 12:08:48 -06:00
Simon Cruanes
037a0ef922 Merge branch 'wip-ccvec' 2019-12-14 12:08:33 -06:00
Fardale
bbdcd93417 wip: improved gc behavior for ccvector 2019-12-14 11:50:47 -06:00
Fardale
1d589cf4ac use array_is_empty_ instead of direct check 2019-12-14 11:50:47 -06:00
Simon Cruanes
28f8872ef5 feat: add monoid_product to Array and Vector 2019-12-10 21:38:07 -06:00
Simon Cruanes
858616606b add CCVector.shrink_to_fit to limit memory usage 2019-12-10 16:39:35 -06:00
Simon Cruanes
1239960c42 wip: improved gc behavior for ccvector 2019-12-10 16:39:35 -06:00
Simon Cruanes
236a0c43ce feat: add CCVector.clear_and_reset 2019-12-10 16:39:35 -06:00
Fardale
3804dbff86 add CCVector.mapi 2019-11-17 10:43:18 -06:00
Simon Cruanes
b3ce398624 fix: remove dep from vec to list 2019-10-30 14:28:17 -05:00
Fardale
0dafceb708 Adding to_string (#270)
* add `CCArray.to_string`
* add `CCArrayLabels.to_string`
* add `CCList.to_string`
* add `CCListLabels.to_string`
* add `CCChar.to_string`
* add `CCPair.to_string`
* add `CCHeap.to_string`
* add `CCSet.to_string`
* add `CCVector.to_string`
2019-10-30 14:26:52 -05:00
Simon Cruanes
96ed8a37ab feat: introduce shim modules for 4.08 compat
- also make `unlabel` an explicit operation
- use `Stdlib` instead of `Pervasives`
- remove some warnings in Format
2019-06-14 18:26:14 -05:00
Simon Cruanes
3712db3a5b chore: use iter, not sequence, in tests 2019-04-13 03:20:56 -05:00
Simon Cruanes
3b0ceb7821 fix(vector): free elements in more functions, add fill_empty_slots_with
see #235
2018-11-30 10:29:08 -06:00
Simon Cruanes
b21ca4e0d8 wip: fix(vec): release elements after their removal
see #235
2018-11-30 10:14:09 -06:00
Simon Cruanes
e530547356 feat(vector): add Vector.{filter,filter_map}_in_place 2018-07-26 04:39:06 -05:00
Simon Cruanes
c800250038 perf: tweaks in CCVector 2018-07-25 14:32:28 -05:00
Simon Cruanes
551c837398 test: more tests for vector 2018-07-25 14:32:28 -05:00
Simon Cruanes
e510e153f8 test: add more tests in vector 2018-07-25 14:32:28 -05:00
Simon Cruanes
1998ed5090 fix(vector): bugfix in filter 2018-07-25 14:32:28 -05:00
Simon Cruanes
640ab72bb2 bugfix in CCVector.slice_seq 2018-03-06 22:28:11 -06:00
Jacques-Pascal Deplaix
9622f6f6ff Avoid uses of the polymorphic operators 2018-01-14 23:32:13 +00:00
Jacques-Pascal Deplaix
6d2063ded4 Internally shadow polymorphic operators and functions from Pervasives 2018-01-14 23:32:13 +00:00
Simon Cruanes
4cc9862ef8 refactoring in vector 2017-09-17 21:37:33 +02:00
Fabian
03f6a1fe5e Use ensure_not_empty_ when vector is known to be non-empty 2017-09-16 21:31:56 +02:00