Skip to content

add more optimization for pure node operations #133

Description

@safareli

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);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions