Skip to content
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

Drop custom prelude #1801

Open
locallycompact opened this issue Jan 27, 2025 · 2 comments
Open

Drop custom prelude #1801

locallycompact opened this issue Jan 27, 2025 · 2 comments

Comments

@locallycompact
Copy link
Contributor

I would like to enable -Wmissing-import-lists globally across the project, but this is unreasonable to do so while we use a custom prelude. Custom preludes (or just re-exports in general) are an impedance to forensics, and to onboarding. It places a high expectation on contributors to learn a new set of defaults when the alternatives are already very widely known. More code is read than written, and it does not save any significant effort, for example, to write writeFileBS rather than BS.writeFile, especially when the latter is already common practice and, given the shortcut is undiscoverable via hoogle, is likely to simply result in corrections in the pull request. I propose to simply delete the prelude, and just use the normal prelude and normal imports, so that we can enable the missing import list warnings.

@ch1bo
Copy link
Member

ch1bo commented Jan 28, 2025

This was an ADR back in the day. Feel free to propose superseding this using your arguments: https://hydra.family/head-protocol/adr/8

@noonio
Copy link
Contributor

noonio commented Jan 28, 2025

I'm tempted to agree with this proposal; I also really dislike the custom prelude, and I agree that things like BS. ... are much easier to understand. I also love explicit imports.

I also agree that it would help onboarding and just general code navigation.

One bonus feature I would request, if we make this change, is to start using PackageImports, which helps a great deal.

Some open questions I wonder about:

  1. Can we take a particularly complex file and see how it would look? I.e. what's the cost in imports? Maybe two examples?
  2. Where would we put common functions that we like to have? spy is pretty easy, we can make a Hydra.Debug module; but maybe there are others?

If you can write up these in an ADR similar to the one linked by @ch1bo then I think we can evaluate and see what everyone thinks.

Thanks for starting this conversation!

@noonio noonio moved this from Triage 🏥 to In Progress 🕐 in ☕ Hydra Team Work Jan 28, 2025
@noonio noonio moved this from In Progress 🕐 to Todo 📋 in ☕ Hydra Team Work Feb 3, 2025
@noonio noonio moved this from Todo 📋 to In Progress 🕐 in ☕ Hydra Team Work Feb 4, 2025
@noonio noonio moved this from In progress 🕐 to Todo 📋 in ☕ Hydra Team Work Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo 📋
Development

No branches or pull requests

3 participants