add range (like python) and id helper functions
This commit is contained in:
parent
538693d9f4
commit
57da947edf
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue