-
Notifications
You must be signed in to change notification settings - Fork 246
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
What names should be used for qualified module imports? #2201
Comments
We have a long tradition of using |
This is one of the areas where I'd lean hard on 'convention' rather than making the style 'standard'. In other words, we won't get complete uniformity, but we'll get a lot closer. For example, points 2-3 above de facto end up being ASCII, so if we remove the first point (because we don't want to change the tradition wrt |
Re: X_p and ASCII And Fin never seems to be consistently named, Properties or otherwise... |
We're importing just |
I'm all for consistency. For sure we'd want to pick a single name for |
This is definitely mostly my fault, I've definitely shifted over the years. My current go-to style is to import
|
I'd been groping towards @MatthewDaggitt 's proposal for a while, but not quite sure if one can simultaneously import That said, I would still prefer to import as literal |
Yup, there's no problem there.
Hmm so this would be naming if after the module name not the datatype name? Or do you mean the datatype name transcribed to ASCII, i.e. would |
Module name. Your thought experiment litmus test example would import as "Foo"... but thanks for the ingenuity of the challenge ;-) |
Okay, so when you said
you weren't supporting my proposal for naming it after the datatype (leaving aside ASCII/non-ASCII)? My feeling is that we want the qualified names of the |
Ok, I see your point. I had been trying to argue for ASCII throughout, and you for datatype name (throughout?, That said, can/should/will we then import the |
The subscript p should definitely go!
Yes, I think so! I think that falls neatly under my proposed scheme of naming the qualifier after the datatype. |
If we're naming the qualifier after the datatype, what should be the convention for datatypes with long names? What about when we're importing two modules for datatypes with the same name, e.g., |
Do we have examples of this in the library, where we need to name those modules for qualified Nevertheless, the question stands, so I suppose we would need to agree a disambiguation scheme, eg in your example, to import as |
Do you have any examples? I'm not aware of any datatypes with ridiculously long names.
I think these should be named after the same datatype as everything else, i.e. the main datatype in We very rarely ever have the case that datatypes have the same name. We usually disambiguate them somehow, e.g. binary naturals, unnormalised rationals etc. so I don't think we'll run into that problem. |
Closed by #2270 ? Or worth keeping open as a reminder to enact the recommendations, both going forward, and when updating old modules...? |
Yes to close, since the style guide has been updated. Opening a fresh issue with a list of the old modules that need to be updated would be a good idea. |
The horror! The horror! What a list... and how to face tackling it... :-( will file an issue in some form or other eventually ;-) |
(Yet) Another style guide convention that it might be good to (try to) standardise... so discussion of what possible conventions might be good/useful/enforceable is in order?
Partly prompted by recent work on v2.0/v2.1 PRs, partly by the realisation that we don't even seem able to agree what to call the PropositionalEquality module when imported qualified...
Possible points:
Data.X
imports via the nameX
?Core
etc.) identifier in the long name otherwiseThe text was updated successfully, but these errors were encountered: