w, x, y, z
次のような高階関数を使用して、引数を効果的にまとめることができます(それらを呼び出します)。
let batchedArgs f = f w x y z
batchedArgs
これで、元の関数の引数を閉じます。同じ数/タイプの引数を取る別の関数を渡すだけで、それらが適用されます。
// other functions which you wish to pass the args to
let sub1 w x y z = 42
let sub2 w x y z = true
// main routine
let doStuff w x y z =
// one-time declaration of batching function is
// the only time you need to list out the arguments
let batchedArgs f = f w x y z
// from then on, invoke like this
batchedArgs sub1
// or like this, which looks more like a traditional function call
sub2 |> batchedArgs