diff --git a/README.md b/README.md index be37999..4778fad 100644 --- a/README.md +++ b/README.md @@ -886,6 +886,16 @@ to implement certain methods then derive the remaining methods. Derivations: } ``` + - [`filter`][] may be derived from [`concat`][], [`of`][], [`zero`][], and + [`reduce`][]: + + ```js + function(pred) { + var F = this.constructor; + return this.reduce((f, x) => pred(x) ? f.concat(F.of(x)) : f, F.zero()); + } + ``` + If a data type provides a method which *could* be derived, its behaviour must be equivalent to that of the derivation (or derivations).