add pair_of_list helper function

This commit is contained in:
Vladan Popovic 2022-12-04 09:32:12 +01:00
parent 883d16a3a3
commit 8a9648ff3e
2 changed files with 5 additions and 4 deletions

View file

@ -18,9 +18,10 @@ let set_of_string str =
aux str ((String.length str) - 1) CS.empty
let map_pair f (a, b) = (f a, f b)
let curry f x y = f (x, y)
let uncurry f (x, y) = f x y
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)