Skip to content

Effect row variable unification #294

Description

@aallan

The type checker implements subeffecting (a function with effects(IO) can be used where effects(IO, State<Int>) is expected) and forall<E> row variables are permissive (they match any concrete effect set), but full row-variable unification is not yet implemented.

Current behavior:

  • Concrete effect sets type-check correctly via subeffecting
  • forall<E> row variables are accepted but not fully unified — they match anything without constraint propagation

What full row-variable unification would enable:

  • Effect polymorphism: a function like forall<E> fn map(fn(A -> B) effects(E), Array<A> -> Array<B>) effects(E) would propagate the callback's effects to the caller
  • Effect set intersection and union constraints

Workaround: Use concrete effect sets in function signatures instead of relying on effect polymorphism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguage-designLanguage semantics and syntax designlimitationKnown compilation limitation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions