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

Prefer composable approach #53

Open
roberth opened this issue Jul 2, 2018 · 4 comments
Open

Prefer composable approach #53

roberth opened this issue Jul 2, 2018 · 4 comments

Comments

@roberth
Copy link

roberth commented Jul 2, 2018

The examples use methods that cause issues when trying to extend the package set further. Using the right tools, which are no harder, we can avoid frustration down the line.

  • Use overlays instead of overrides. They are the way to go, because they are more powerful and, I'd argue, more consistent: overlays for packages sets, overrides for packages.
  • Avoid rec keyword. People get used to it and will use it in overlay definitions, leading to surprises.
  • Use haskellPackages.extend instead of .override { overrides =. It lets you add more layers of overrides which is more flexible. Attempting the same on the current code replaces the single layer of overrides with the new one, which is unexpected. As a bonus, it is syntactically simpler.
@Gabriella439
Copy link
Owner

Yeah, I agree with using overlays. I've been using them both at work and also in some personal projects and I'm very happy with them.

I also agree with avoiding rec (in favor of chaining multiple overlays)

I didn't know about extend, though. Let me check that out and learn how it works

@sboosali
Copy link

sboosali commented Jul 2, 2018 via email

@sboosali
Copy link

sboosali commented Jul 2, 2018 via email

@sorki
Copy link

sorki commented Apr 27, 2020

Adding two examples of Haskell overlays which you might find handy:

I'm still not sure if this is their final form as there's some clutter I would like to refactor. Feedback welcome - I will try to create a PR for this repository with the example when I'm sure about the approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants