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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions