Skip to content

Conversation

@jamesmckinna
Copy link
Collaborator

Lightened dependency on Data.Nat.Base
Removed dependency on Data.Nat.Properties

Lightened dependency on `Data.Nat.Base`
Removed dependency on `Data.Nat.Properties`
@jamesmckinna
Copy link
Collaborator Author

jamesmckinna commented Sep 30, 2022

This arises as a knock-on effect of working on PR #1837. It's 'trivial', and removes dependencies which nevertheless reappear if you wish to consider Properties of musical colists...
... so the real reason for flagging it is to draw attention to a separate 'library design' issue: should one include 'redundant' imports in 'base' files, in order to cue the reader to their need to be imported in cognate client modules?

@MatthewDaggitt
Copy link
Collaborator

should one include 'redundant' imports in 'base' files, in order to cue the reader to their need to be imported in cognate client modules?

No I don't think so. We should keep the imports minimal. Otherwise you end up importing large portions of the library that you don't want. Have I got the right end of the stick?

@jamesmckinna
Copy link
Collaborator Author

@MatthewDaggitt Matthew, I agree with you (and you have the right end of this stick).

But I've noticed more than once that this ('over-importing') is a 'pattern' (not sure what to call it; a tic, perhaps) in the library... so one day we might need to do a more systematic trawl to minimise imports everywhere. But I'm reluctant to do such a systematic job, except on a case-by-case basis with each PR, as I find it hard to think about how to rationally/better/best prune the import interfaces with 'using'... and I'm not always clear what the 'rational' pruning strategy might be... because the more you name, the more knock-on viscosity you have to deal with when you you rename, etc.

@MatthewDaggitt
Copy link
Collaborator

But I've noticed more than once that this ('over-importing') is a 'pattern' (not sure what to call it; a tic, perhaps) in the library... so one day we might need to do a more systematic trawl to minimise imports everywhere.

Yes it's a legacy of our refactorings that don't update the imports when we shift contents out of modules. To be honest its near impossible to keep track of unused imports without editor support. One of the things that it would be great to add to the Agda language server (and put in the infrastructure grant proposal).

@MatthewDaggitt MatthewDaggitt merged commit 4b7e69b into agda:master Oct 4, 2022
@jamesmckinna jamesmckinna deleted the musical-colist-dependency branch October 4, 2022 16:00
@andreasabel andreasabel mentioned this pull request Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants