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

Better shim libraries #4167

Open
Ericson2314 opened this issue Dec 13, 2016 · 5 comments
Open

Better shim libraries #4167

Ericson2314 opened this issue Dec 13, 2016 · 5 comments
Labels
Cabal: file format old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: enhancement
Milestone

Comments

@Ericson2314
Copy link
Collaborator

Ericson2314 commented Dec 13, 2016

I'd love to ditch names like transformers-compat and instead allow libraries to declare private dependencies on new versions of themselves.

The harder part of this is private dependencies of course but #4104 also helps in that by making version bounds that exclude internal components and error today. That way tomorrow we are free to assign brand new meaning to them (i.e. actually depend on a newer version of me, please) tomorrow without breaking any existing packages.

@phadej
Copy link
Collaborator

phadej commented Dec 13, 2016

Sorry, I don't understand this issue, can you give an example how you want things to be?

@Ericson2314
Copy link
Collaborator Author

Ericson2314 commented Jan 3, 2017

Sorry for not responding earlier. Also I realized I misunderstood transformers-compat in that it works in the opposite fashion.

The goal is say I have a library foo, with releases versions 0.1.9.0 and 0.2.0.0. But I don't want to leave my 0.1.x.y users high and dry, and I only broke a few interfaces in 0.2.0.0. The purpose of this feature would be to allow me to write a 0.1.10.0 that depends on 0.2.*.* and mostly reexports compatible definitions, but wraps/replaces incompatible ones when necessary.

@Ericson2314
Copy link
Collaborator Author

Ericson2314 commented Jan 16, 2017

@phadej Ah, I just discovered

-- This makes it possible to have base shims.
I think what I want is a generalization of this, to allow any package depending on a new generation of itself.

@phadej
Copy link
Collaborator

phadej commented Jan 17, 2017

I.e. you want to have

name: mylib
version: 0.1.10

library:
  build-depends: mylib >= 0.2 && <0.3

IMHO it's not worth it. There are quite a lot of difficulties (with shadowing modules, types, you cannot shim classes/instances anyway). I'd just create a compat library (in either direction).

@phadej
Copy link
Collaborator

phadej commented Jan 17, 2017

Also, transformers-compat works around a problem maybe not so obvious: in some setups transformers isn't upgradeable (i.e. if you depend on ghc lib).

And indeed, transformers-compat adds functionality to old transformers, which is introduced in the new one.

And e.g. Data.Functor.Classes is an example of a module you cannot shim, even if you want very very much. (huge difference between trransformers-0.4 and transformers-0.5 / base-4.9).

@23Skidoo 23Skidoo added this to the milestone Oct 15, 2017
@andreabedini andreabedini added the old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cabal: file format old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: enhancement
Projects
None yet
Development

No branches or pull requests

4 participants