diff --git a/lib/utils.ml b/lib/utils.ml index 5722ce1..5918ea9 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -25,3 +25,11 @@ let uncurry3 f (x, y, z) = f x y z let swap x y = y x let pair_of_list l = (List.hd l, List.tl l |> List.hd) + +let range x = + let rec aux n res = + if n = 0 then res + else aux (n - 1) (n :: res) in + aux x [] + +let id x = x