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)
450450An 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:
451451
452452__ 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+
456460
457461__ Composable__
458462
463+ ``` js
464+ object .map (compose (f, g))
459465```
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)
461471```
462472
463- (` f ` , ` g ` are arbitrary functions)
473+ (` f ` , ` g ` are arbitrary composable functions)
464474
465475A common functor in JavaScript is ` Array ` since it abides to the two functor rules:
466476
You can’t perform that action at this time.
0 commit comments