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

More ergonomic way to use a super package #192

Open
srid opened this issue Aug 19, 2023 · 3 comments
Open

More ergonomic way to use a super package #192

srid opened this issue Aug 19, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@srid
Copy link
Owner

srid commented Aug 19, 2023

This is a bit unwieldy

          settings = {
            fourmolu = { super, ... }: { custom = _: super.fourmolu_0_13_1_0; };
          };
@roberth
Copy link
Collaborator

roberth commented Aug 19, 2023

Perhaps super could be a module argument in settings?

settings = { super, ... }: {
  fourmolu.custom = super.fourmolu_0_13_1_0;
};

It reduces the incremental cost per package. Or isn't it already? It's not a submodule, but you can probably get the same behavior with coercedTo (attrsOf ...) (x: _unused: x) (functionTo (attrsOf ...)).

@roberth
Copy link
Collaborator

roberth commented Aug 19, 2023

Another thing you could try is to parse the version suffixes and write some logic that gets the right one even if the minor or patch versions change etc. ie user could specify a version range or something.

settings.fourmolu.range = "0.13.*";

That needs a bunch more code than my other suggestion though.

@srid
Copy link
Owner Author

srid commented Aug 19, 2023

Perhaps super could be a module argument in settings?

This is what I was originally going for, but I was unable to implement it for reasons that I no longer recall. But this would be the ideal API, yes.

@srid srid added the help wanted Extra attention is needed label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants