Skip to content

Commit

Permalink
add Filterable (fix #46)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpominov authored Feb 15, 2018
1 parent fc5ef4c commit 8e23869
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ equivalent to that of the derivation (or derivations).
* [Group](#group)
* [Semigroupoid](#semigroupoid)
* [Category](#category)
* [Filterable](#filterable)
* [Functor](#functor)
* [Bifunctor](#bifunctor)
* [Contravariant](#contravariant)
Expand Down Expand Up @@ -250,6 +251,21 @@ support `Semigroupoid` algebra for the same `T`, and obey following laws:
1. Left identity: `M.compose(M.id(), a) ≡ a`


### Filterable

```js
Filterable<T> {
filter: <a>(a => boolean, T<a>) => T<a>
}
```

Module must match the `Filterable` signature for some type `T`, and obey following laws:

1. Distributivity: `F.filter(x => f(x) && g(x), a) ≡ F.filter(g, F.filter(f, a))`
1. Identity: `F.filter(x => true, a) ≡ a`
1. Annihilation: `F.filter(x => false, a) ≡ F.filter(x => false, b)`


### Functor

```js
Expand Down

0 comments on commit 8e23869

Please sign in to comment.