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

Do supports destructuring binding #48

Open
kgtkr opened this issue Feb 15, 2020 · 1 comment
Open

Do supports destructuring binding #48

kgtkr opened this issue Feb 15, 2020 · 1 comment

Comments

@kgtkr
Copy link
Contributor

kgtkr commented Feb 15, 2020

🚀 Feature request

Related #35

Do does not support destructuring binding.

do
  (a, b) <- m
  let (a, b) = x
  ...

Suggested Solution

.bindD(m.map(x => ({ a: x.a, b: x.b }))) === .bind("tmp", m).letL("a" ,({ tmp }) => tmp.a).letL("b" ,({ tmp }) => tmp.b)
.bindDL(() => m.map(x => ({ a: x.a, b: x.b }))) === .bindL("tmp", () => m).letL("a" ,({ tmp }) => tmp.a).letL("b" ,({ tmp }) => tmp.b)
.letD({ a: 1, b: 2 }) === .sequenceS({ a: M.of(1), b: M.of(2) })
.letDL(() => ({ a: 1, b: 2 })) === .sequenceSL(() => ({ a: M.of(1), b: M.of(2) }))
@cyberixae
Copy link
Sponsor

I just created PR #59 that implements chain and chainL. I'm not sure if it solves the problem but maybe you could take a look at it.

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