Skip to content

A tuple pattern for built-in signatures #344

Open

Description

@timfennis

A built-in's signature can't say "a tuple of any length", so first, last and zip have one overload per tuple length, up to twelve (#342), as Rust's standard library does for tuples. Longer tuples fail analysis, though the implementations take them.

Proposal: a tuple pattern in signatures, such as <A>((A, ..)) -> A for "a tuple of at least one element, starting with A", or <T..>(Iterable<T>..) -> List<(T..)> for zip. It's a new type form, so every match on tuple types in the analyser, the VM's conformance checks and the LSP has to handle it; worth it once more built-ins need it.

🤖 Generated with Claude Code

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions