mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
add CCVector.append_gen
This commit is contained in:
parent
3e50420ce8
commit
e4c6752b6b
2 changed files with 18 additions and 0 deletions
|
|
@ -226,6 +226,20 @@ let append_list a b = match b with
|
|||
length v = List.length l1 + List.length l2)
|
||||
*)
|
||||
|
||||
let rec append_gen a b = match b() with
|
||||
| None -> ()
|
||||
| Some x -> push a x; append_gen a b
|
||||
|
||||
(*$Q
|
||||
Q.(pair (list int)(list int)) (fun (l1,l2) -> \
|
||||
let v = of_list l1 in append_gen v (Gen.of_list l2); \
|
||||
to_list v = (l1 @ l2))
|
||||
Q.(pair (list int)(list int)) (fun (l1,l2) -> \
|
||||
let v = of_list l1 in append_gen v (Gen.of_list l2); \
|
||||
length v = List.length l1 + List.length l2)
|
||||
*)
|
||||
|
||||
|
||||
(*$inject
|
||||
let gen x =
|
||||
let small = length in
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@ val append_list : ('a, rw) t -> 'a list -> unit
|
|||
(** Append content of list
|
||||
@since 0.14 *)
|
||||
|
||||
val append_gen : ('a, rw) t -> 'a gen -> unit
|
||||
(** Append content of generator
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val equal : 'a equal -> ('a,_) t equal
|
||||
|
||||
val compare : 'a ord -> ('a,_) t ord
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue