Standardise names for qualified module imports
Task list to address #2201 , itemised by what needs to change (with proposed changes), rather than where (too many imports to list!):
- [ ]
*.BundlesasBundles - [ ]
*.Bundles.RawasRaw - [ ]
*.Consequences{.*}asConsequences - [ ]
*.Construct.CompositionasComposition - [ ]
*.Construct.IdentityasIdentity - [ ]
*.DefinitionsasDefinitions - [ ]
*.Effectful.TransformerasTransformer - [ ]
*.StructuresasStructures - [x]
Data.Nat{.*}asℕ#2281 - [x]
Data.Integer.Divisibility: this module makes qualified imports from variousData.Natmodules, but it doesn't seem easy to import them all under a single qualified nameℕ, because the structure seems to need to export the constructordividesofData.Nat.Divisibility, leading to a disambiguation error... perhaps this can be renegotiated/refactored via ~~Data.Nat.Divisibility.Core~~ introducing a pattern synonym? #2294 - [x]
Data.Product.BaseasProduct(orΣ?) #2284 NB Data.Container.* yields non-trivial ambiguities - [x]
Data.Sum.BaseasSum(or⊎?) #2290 NB Data.Container.* yields non-trivial ambiguities - [x]
Data.X.PropertiesasX, rather thanXₚwithXthe datatype name, not the ASCII module name (as inℕabove) #2283 NB see the caveats on that PR - [ ]
Function.*asFunction - [x]
Relation.Binary.PropositionalEquality{.*}#2293 (systematic but terrifyingly pointless) - [x]
Relation.Binary.Reasoning.Setoidas≈-Reasoningby analogy with≡-Reasoning#2282 / #2309 - [ ]
Relation.Binary.*asBinary - [ ]
Relation.Nullary.*asNullary(exceptions forDecidableandNegation?) - [ ]
Relation.Unary.*asUnary - [x]
README.*#2313 - [ ] ...
TODO: update style-guide to incorporate the conventions:
- [ ] final choices of names for
SumandProduct - [ ] ...
Things to leave alone:
- [ ]
Foreign.* - [ ]
System.* - [ ] ...
Design decisions/outstanding questions:
- use of Unicode: we had agreed in #2201 to the use of
ℕas the qualified module name for the (most-?) common cases of importing qualified fromData.Nat.*, and equality as≡fromRelation.Binary.PropositionalEquality.*; but as the list above asks: what about the qualified import names forSumandProduct? - what to do where the style guide recommendations cannot be followed?
NB. Each of the above tasks/associated PRs seems to have one or two 'leftovers', so a final 'mop-up' PR may well be in order once the above list (or a suitable subset) is completed.
On #2284 @JacquesCarette wrote:
Sigh -
Productis non-trivially longer thanProd. But this is the right thing to do.
So... I've been reconsidering this, and wondered if, instead, and in line with the 'datatype name as root module name' heuristic, that we standardise on import Data.Product.Base as Σ?
Originally posted by @jamesmckinna in https://github.com/agda/agda-stdlib/issues/2284#issuecomment-1937722328
Single precedent in stdlib: Data.Vec.Functional.Relation.Unary.Any!
And as I said on #2284 , I think that's a reasonable suggestion. (I'm still torn because my math background wants me to see Σ as a sum, and I can't be the only one. But that ship has sailed a long time ago, so I'm definitely not going to re-litigate that.)
Re: #2284 I think the maintainers should all agree on this, and then revert that PR in favour of the new suggestion, if necessary.