haskell.nix icon indicating copy to clipboard operation
haskell.nix copied to clipboard

Package sets contain a mixture of things

Open michaelpj opened this issue 5 years ago • 7 comments

At the moment the package sets produced by e.g. cabalProject contain:

  1. Attributes for every Haskell package in the package set
  2. Some additional things, at least shellFor and ghcWithPacakges

This seems suboptimal to me, for two reasons:

  • We don't control the set of names needed for 1, so we could in principle get clashes. But I'm sure nobody will ever add a package called "shellFor". Right?
  • 1 and 2 are just very different kind of things. At least in my head the package set was a map-like attribute set rather than a namespace-like attribute set, so I'd expected it to be homogeneous.

This mostly just causes confusion . I spent quite a while looking for shellFor, since surely it couldn't be just mixed up in all the package attributes? But it is.

I'd prefer to have a level of indirection, e.g.

{
    packages = { ... }
    shellFor = ...
    ghcWithPackages = ...
}

This would be a breaking change, though.

michaelpj avatar Feb 24 '20 15:02 michaelpj

Sounds like a reasonable change. It currently matches the layout in the Nixpkgs Haskell infrastructure pkgs.haskellPackages.shellFor.

rvl avatar Mar 03 '20 00:03 rvl

Sounds like a reasonable change. It currently matches the layout in the Nixpkgs Haskell infrastructure pkgs.haskellPackages.shellFor.

That's a very sensible reason to have it be that way. I guess I disagree with nixpkgs too ;)

michaelpj avatar Mar 09 '20 10:03 michaelpj

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 28 '22 23:09 stale[bot]

I still care!

michaelpj avatar Sep 29 '22 09:09 michaelpj

Should we drop cabalProject and rename cabalProject' to cabalProject?

hamishmack avatar Sep 29 '22 11:09 hamishmack

I think we should drop project too. It's a minor convenience that doesn't really give you anything. Whether your project uses Stack or Cabal isn't something that changes, hence you write it once and that's it.

L-as avatar Sep 29 '22 11:09 L-as

Should we drop cabalProject and rename cabalProject' to cabalProject?

:+1: in my book, I can't remember whether the hsPkgs inside there also has some non-package stuff in it, should check. But maybe some people like the short version.

michaelpj avatar Sep 29 '22 13:09 michaelpj