Using equivalent operator for functor laws

...as opposed to threequals
This commit is contained in:
Jethro Larson 2016-11-04 14:57:48 -07:00 committed by GitHub
parent 86d9603981
commit eceef7553d

View file

@ -313,16 +313,15 @@ john.age + five === ({name: 'John', age: 30}).age + (5)
An object that implements a `map` function which, while running over each value in the object to produce a new object, adheres to two rules:
```js
// preserves identity
object.map(x => x) === object
### Preserves identity
```
object.map(x => x) object
```
and
### Composable
```js
// composable
object.map(x => f(g(x))) === object.map(g).map(f)
```
object.map(compose(f, g)) ≍ object.map(g).map(f)
```
(`f`, `g` be arbitrary functions)