Commit cc08be06 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Add [Misc.list_make].

parent 1f7802d0
......@@ -416,3 +416,6 @@ let array_for_all2 p l1 l2 =
else if p (Array.unsafe_get l1 i) (Array.unsafe_get l2 i) then loop (succ i)
else false in
loop 0
let rec list_make n x =
if n = 0 then [] else x :: list_make (n - 1) x
......@@ -190,3 +190,7 @@ val nth: int -> string
val array_for_all : ('a -> bool) -> 'a array -> bool
val array_for_all2 : ('a -> 'b -> bool) -> 'a array -> 'b array -> bool
(* [List.make] *)
val list_make: int -> 'a -> 'a list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment