Let's say you have two completely separate projects, one of which is called my-library , and the other is my-project . And my-project depends on my-library .
The way to create my-library and make it available to other cabal install my-library projects. After that, any other project can use the library.
You are now ready to build my-project with the cabal install my-project command. It will not rebuild or reinstall my-library , but it will link your project to the library.
Now, if you make changes to my-library , be sure to update the version number before running cabal install my-library . If you forget to specify the version number, you will be warned that my-project will be deprecated. Now the old versions and the new version of your library are available for other projects.
You can continue to carry out your projects. They will gladly continue to use the previous version of my-library until they make another cabal install my-project . Therefore, there is no need to reinstall everything after each change.
If you want to rebuild your projects, but continue to work with the old version of your library, you can specify this in the build-depends section of your cabal file. For example, if you have installed versions 1.0 and 2.0 from my-library , you can create your project against an older version as follows:
build-depends: my-library==1.0, ...
source share