File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -450,17 +450,27 @@ Object whose `chain` doesn't transform the contents. See [Monad](#monad)
450
450
An object that implements a ` map ` function that takes a function which is run on the contents of that object. A functor must adhere to two rules:
451
451
452
452
__ Preserves identity__
453
- ```
454
- object.map(x => x) ≍ object
455
- ```
453
+
454
+ ``` js
455
+ object .map (x => x)
456
+ ```
457
+
458
+ is equivalent to just ` object ` .
459
+
456
460
457
461
__ Composable__
458
462
463
+ ``` js
464
+ object .map (compose (f, g))
459
465
```
460
- object.map(compose(f, g)) ≍ object.map(g).map(f)
466
+
467
+ is equivalent to
468
+
469
+ ``` js
470
+ object .map (g).map (f)
461
471
```
462
472
463
- (` f ` , ` g ` are arbitrary functions)
473
+ (` f ` , ` g ` are arbitrary composable functions)
464
474
465
475
A common functor in JavaScript is ` Array ` since it abides to the two functor rules:
466
476
You can’t perform that action at this time.
0 commit comments