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
Implicit module names #321
base: master
Are you sure you want to change the base?
Implicit module names #321
Conversation
28644b8
to
4b8bf1f
Compare
4b8bf1f
to
c0b039d
Compare
Endorsements | ||
------------- | ||
|
||
.. _`Proposal 316`: https://github.com/ghc-proposals/ghc-proposals/pull/a316 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link is borked due to stray a
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks1
There are use-cases for referring to the current module inside this module; export lists and qualified names. So can you still do something the equivalent of
or
with your extension? Do you then again need to “guess” the right module name, or do you envision some way of referring to “the present module” without knowing its name? |
@nomeata That is a good question. The simplest implementation would allow one to guess the module name, but I think I would rather have a dedicated way to refer the the current module. I haven't thought of a name yet, but I guess that could be a part of this proposal. |
What about plain module (module) where … module where
tail = undefined
foo = module.tail -- disambguate |
Just a brief thought, module where
tail = undefined
foo = here.tail -- disambguate |
I don't find the motivation convincing here. I acknowledge the comment at the end of the proposal that aims to be more future-oriented than history-oriented, but still don't see enough of the eventual benefit to warrant yet another extension. Also: the module name matters, because it is what is used in |
@iamrecursion I was hoping to avoid introducing yet another contextual keyword. Also, if the record dot notation passes the
I don't like strings or the file system either? I ideally would like to edit the AST of my entire package a thoroughly de-unixed IDE, but as long as modules contain their names that AST is going to be denormalized---I'm too "constructivist" to think of a package as a set of modules whose names happen to not overlap, I really want the map as part of the AST, and ideally nested maps for hierarchical module names. |
That last bit reminds me, there is also some relation to the local modules / first class modules / structured imports exports proposals. There was some interest in a uniform binding syntax like |
How about using module as A where
undefined = A.undefined That could also be useful in named modules: module My.Long.Module.Name.That.Might.Change as A where
undefined = A.undefined |
Allow plain
module where
, inferring the name from context.Rendered