Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t realize ap composition #175

Open
Ne4to777 opened this issue Dec 19, 2019 · 1 comment
Open

Can`t realize ap composition #175

Ne4to777 opened this issue Dec 19, 2019 · 1 comment

Comments

@Ne4to777
Copy link

Fantasy Land spec:
v.ap(u.ap(a.map(f => g => x => f(g(x))))) is equivalent to v.ap(u).ap(a) (composition)

Implementation:

const v = Future.of(x => y => x + y)
const u = Future.of(1)
const a = Future.of(2)

v
.ap(u)
.ap(a)
.fork(console.error, console.log) // OK

v
.ap(u
.ap(a
.map(f => g => x => f(g(x)))))
.fork(console.error, console.log) // TypeError: applyFn is not a function

@CrossEye
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants