mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +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.
|
||||
|
||||
```js
|
||||
let CoIdentity = v => ({
|
||||
const CoIdentity = v => ({
|
||||
val: v,
|
||||
extract: this.v,
|
||||
extend: f => CoIdentity(f(this))
|
||||
extract() { return this.val },
|
||||
extend(f) { return CoIdentity(f(this)) }
|
||||
})
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue