If I have a function returning a tuple (a * b * c)
and I want to immediately pass it into another function with type a -> b -> c -> T
, is there a way to do it other than tediously expanding it like this:
let (a, b, c) = my_tuple inmy_function a b c
ChatGPT suggested I write a helper function:
let apply_tuple3 (f : 'a -> 'b -> 'c -> 'd) ((a, b, c) : 'a * 'b * 'c) : 'd = f a b c
which is not variadic... It's fine I guess, but surely something like this exists already? It seems like an obvious task.