This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Class equipped with static functions used to apply functions to themselves. | |
| * Lambda functions can be made recursive with this technique. | |
| * <p> | |
| * The function below is the recursive definition of the factorial function. | |
| * <pre><code> | |
| * Function<Integer,Integer> rec = fix(f -> n -> (n > 1) ? n * f.get().apply(n - 1) : 1); | |
| * </code></pre> | |
| */ | |
| public final class Fix { |