add another test

This commit is contained in:
Simon Cruanes 2018-02-04 12:05:58 -06:00
parent 9e51f8dc77
commit 6b48fe873e

View file

@ -1258,6 +1258,12 @@ let replicate i x =
repeat 2 [1;2;3] = [1;2;3;1;2;3]
*)
(*$Q
Q.(pair small_int (list int)) (fun (n,l) -> \
if n>0 then repeat n l = flat_map (fun _ -> l) (1--n) \
else Q.assume_fail())
*)
let repeat i l =
let rec aux acc i =
if i = 0 then List.rev acc