Sometimes a project can be organized either as a single package or as several packages. When one is in such a situation, how should one decide which option is better?
There are some immediate drawbacks of distributing a project over multiple packages:
cabal build
But there are also potential benefits for users that would only depend on a subset of the packages:
And there are some benefits even if users end up depending on all packages:
I think the decision should be based on whether you think that there are users that can actually realize the potential benefits. So I would say that the decision depends mostly on the answers to the following questions:
Finally, with cabal there is a middle ground between "one package" and "many packages", because one cabal package can contain both one library and any number of executables, test-suites and benchmarks. This covers one important reason that would otherwise lead to split packages: Users should not have to depend on the testing libraries just to use the package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With