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

Separate libraries #2

Merged
merged 1 commit into from
Jul 16, 2023
Merged

Separate libraries #2

merged 1 commit into from
Jul 16, 2023

Conversation

tfausak
Copy link
Owner

@tfausak tfausak commented Jul 16, 2023

I don't really have any experience working with multiple libraries in a single package. I figured I could use this package as a test bed for that. This PR breaks up the previously monolithic package into separate libraries:

  • unstable: This is where everything actually lives. Previously it was just a different module namespace (Saturn.Unstable.*). Now it's also a separate package component (saturn:lib:unstable).
  • saturn: This is the default public library and now it only exports the Saturn module. Everything else lives in unstable.
  • spec: This is where all the tests live. Since there are useful functions (like arbitrary, shrink, and new) defined for each type, it seemed like a good idea to have this live in a library rather than a test-suite.

In terms of behavior, everything should be the same as before. I only changed package organization and tests.

@tfausak tfausak merged commit efae9e4 into main Jul 16, 2023
@tfausak tfausak deleted the 2023-07-16-atomize branch July 16, 2023 20:37
@tfausak tfausak mentioned this pull request Jul 16, 2023
@tfausak
Copy link
Owner Author

tfausak commented Jul 28, 2023

One (major) downside of this approach is that Cabal's solver isn't really aware of sub-libraries: haskell/cabal#4087

That means the dependency solver tries to find a solution for all sub-libraries, even if you don't actually depend on them. Practically, that means you can only use saturn if your versions of hspec and QuickCheck match up, even if you don't depend on saturn:lib:spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant