In Haskell, there's a function flip
for this. You can define it yourself:
let flip f x y = f y x
Then you can say:
other_func (func 5)
third_func (flip func "abc")
Flip is defined in Jane Street Core as Fn.flip
. It's defined in OCaml Batteries Included as BatPervasives.flip
. (In other words, everybody agrees this is a useful function.)