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

add more optimization for pure node operations #133

Open
safareli opened this issue Dec 13, 2017 · 0 comments
Open

add more optimization for pure node operations #133

safareli opened this issue Dec 13, 2017 · 0 comments

Comments

@safareli
Copy link
Contributor

safareli commented Dec 13, 2017

in _map we have

if (aff.tag === Aff.Pure.tag) {
  return Aff.Pure(f(aff._1));
}

same could be done in apply:

if (effF.tag === Aff.Pure.tag) {
  if (eff.tag === Aff.Pure.tag) {
    return new Aff.Pure(effF._0(eff._0));
  }
  return new Aff.Map(effF._0, eff);
}

and in bind:

if (eff.tag == PURE) {
  return f(eff._0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant