haskell-flake icon indicating copy to clipboard operation
haskell-flake copied to clipboard

More ergonomic way to use a `super` package

Open srid opened this issue 2 years ago • 3 comments

This is a bit unwieldy

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

srid avatar Aug 19 '23 15:08 srid

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 avatar Aug 19 '23 16:08 roberth

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.

roberth avatar Aug 19 '23 16:08 roberth

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 avatar Aug 19 '23 22:08 srid