Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent rules of automatic binding of types and values in patterns #119

Open
ppolesiuk opened this issue Jun 4, 2024 · 0 comments
Open
Labels
proposal New ideas that should be discussed, but not necessarily implemented

Comments

@ppolesiuk
Copy link
Member

If a constructor pattern or a polymorphic actual parameter does not mention some named parameter, it could be introduced to the environment or not. Currently implemented rules are not very consistent:

data T = C of {`n : Int}
let f C = `n (* is valid, because `n was implicitly introduced *)
let g (C { module M }) = `n (* Unbound implicit `n *)

nor intuitive:

let f (g : ({x} -> _) -> _) = g x (* is valid, since x was implicitly introduced *)

We should develop more clear, consistent, and intuitive rules how this feature should behave.

@ppolesiuk ppolesiuk added the proposal New ideas that should be discussed, but not necessarily implemented label Jun 4, 2024
@ppolesiuk ppolesiuk mentioned this issue Jan 13, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal New ideas that should be discussed, but not necessarily implemented
Projects
None yet
Development

No branches or pull requests

1 participant