mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-11 04:56:40 +00:00
Merge pull request #43 from brunops/fix-comonad-example
Fix Comonad example
This commit is contained in:
commit
b528aa9adc
1 changed files with 3 additions and 3 deletions
|
|
@ -442,10 +442,10 @@ compose(foo, identity) ≍ compose(identity, foo) ≍ foo
|
||||||
> An object that has `extract` and `extend` functions.
|
> An object that has `extract` and `extend` functions.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let CoIdentity = v => ({
|
const CoIdentity = v => ({
|
||||||
val: v,
|
val: v,
|
||||||
extract: this.v,
|
extract() { return this.val },
|
||||||
extend: f => CoIdentity(f(this))
|
extend(f) { return CoIdentity(f(this)) }
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue