strategy pattern

The strategy pattern is a design pattern that enables selecting an algorithm at runtime. Instead of implementing a single algorithm directly, code receives run-time instructions as to which in a family of algorithms to use.
Strategy lets the algorithm vary independently from clients that use it.
In OOP languages this generally involves separate classes for each strategy which they all implement a common interface, then another class makes use of the strategy interface without actually knowing which strategy implementation has been selected at runtime, with this we separate the concerns of selecting the algorithm and the differences in implementation between strategies while having the possibility of selecting one or the other during runtime.
In FP, the Strategy Pattern becomes just as simple as passing a function as a parameter. There is much less code involve because we don't have to depend on classes or inheritance to achieve the same functionality.