高階関数とは何か?
高階関数は、他の関数を引数として受け取る、結果として返す、あるいはその両方によって、他の関数を対象に操作する関数です。これは、関数が他のデータと同じように持ち回せる第一級の値であることに依存します。よくある例には、要素ごとの作業を記述する関数を受け取るmap、filter、reduceがあります。
なぜ重要か
高階関数により、値だけでなく振る舞いを抽象化でき、繰り返しの多い制御フローのボイラープレートを取り除けます。これは、合成可能な関数型やcallbackベースのAPIの背後にある中核的な仕組みです。
関連ガイド
What Is Currying?Currying transforms a function of several arguments into a chain of functions each taking one argument and re…
What Is Partial Application?Partial application fixes some of a function arguments in advance to produce a new, more specialized function…
What Is a Functor in Functional Programming?A functor is a type that can be mapped over, applying a function to the values it contains while preserving i…