mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
use method shorthand for comonad example
This commit is contained in:
parent
6ce00b53a5
commit
d857ea9598
1 changed files with 3 additions and 3 deletions
|
|
@ -439,10 +439,10 @@ compose(foo, identity) ≍ compose(identity, foo) ≍ foo
|
|||
> An object that has `extract` and `extend` functions.
|
||||
|
||||
```js
|
||||
let CoIdentity = v => ({
|
||||
const CoIdentity = v => ({
|
||||
val: v,
|
||||
extract: function () { return this.val },
|
||||
extend: function (f) { return CoIdentity(f(this)) }
|
||||
extract() { return this.val },
|
||||
extend(f) { return CoIdentity(f(this)) }
|
||||
})
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue