From eceef7553d361f7faf8410d8f39bd06430c81eb2 Mon Sep 17 00:00:00 2001 From: Jethro Larson Date: Fri, 4 Nov 2016 14:57:48 -0700 Subject: [PATCH] Using equivalent operator for functor laws ...as opposed to threequals --- readme.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index f6cbf40..d624e89 100644 --- a/readme.md +++ b/readme.md @@ -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)