Skip to content

Feature request: switch from infer to check when given "concrete" infer pattern #96

@wilbowma

Description

@wilbowma

Not actually sure this is possible, but it ought to be, intuitively.

For context, I'm starring at this line
https://github.com/wilbowma/cur/blob/turnstile-merging/cur-lib/cur/curnel/turnstile-impl/dep-ind-cur2%2Bdata2.rkt#L346

This line annoys me because it branches on the number of parameters and indices, but actually has nothing to do with the number of parameters and indices. Instead, it is giving better inference and error messages by switching to check mode instead of inference mode when possible. This is possible to do this when we would be generating a pattern that is actually a concrete type, and it happens to be the case that we would generate a concrete type when there are 0 parameters and indices.

It seems like Turnstile ought to be able to detect when a infer pattern is actually concrete syntax instead of a pattern, and automatically switch from infer to check in that case. If so, it would be a great feature, as it would automagically improve a user's type system.

This situation probably doesn't come up so much in source Turnstile, but comes up any time we use this pattern variable instantiation technique, i.e., when generating Turnstile.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions