-
Notifications
You must be signed in to change notification settings - Fork 57
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
Extending type modules #3327
Comments
Just a note on the syntax: these semicolons in the middle (before |
Agreed, we could remove them
I think we kept them so that if we add module arguments we don't have parsing problems. But maybe parse it correctly with some backtracking even if we have module arguments. |
Or we could (more consistently) use, e.g.,:
? |
That makes sense |
Context
While writing apps, we've realized that the following pattern is quite common:
We follow this pattern because we always want to use
ExternalIdentity.toNat
rather thantoNat
directly.Essentially, this pattern is a workaround to extend the local module
SatisfiedIndent
implicitly defined by the type definition ofSatisfiedIntent
.Proposal
I propose that we allow users to extend the module implicitly defined by type definitions by appending
with module
to the type definition. Then, all definitions in that (nameless) module will be appended to the implicit module that we generate.With the proposed syntax the example above would become:
The text was updated successfully, but these errors were encountered: