Skip to content

Import Multiplicity from GHC.Types#509

Merged
aspiwack merged 1 commit into
tweag:masterfrom
tomsmeding:multiplicity-from-ghc-prim
May 20, 2026
Merged

Import Multiplicity from GHC.Types#509
aspiwack merged 1 commit into
tweag:masterfrom
tomsmeding:multiplicity-from-ghc-prim

Conversation

@tomsmeding
Copy link
Copy Markdown
Contributor

GHC 9.2 did not yet export Multiplicity from GHC.Exts. The rest of the repository imports Multiplicity from ghc-prim:GHC.Types, from which the type has always been exported, but this one occurrence in Control.Functor.Linear.Internal.Reader didn't.

This fixes compatibility with GHC 9.2, which did not yet export
Multiplicity from GHC.Exts.
@aspiwack
Copy link
Copy Markdown
Member

Does linear-base even compile with GHC 9.2 (other than this infelicity?). I confess that I'm rather a burn-bridges kind of person, and I tend to drop support for old versions as soon as they become inconvenient.

I agree that it's better to be uniform, but on the other hand, GHC.Types is is ghc-prim and GHC.Exts is in base. So it's generally preferable to import from the latter (maybe we can even drop our direct dependency on ghc-prim, that could be nice; even if for a library like linear-base, it's not particularly surprising to depend on ghc-prim).

On the other other hand, I assume that this pull request comes from a need. Could you elaborate the need a little?

@tomsmeding
Copy link
Copy Markdown
Contributor Author

For me personally, it doesn't matter if you fix the import or increase your lower bound on base. :)

I operate the playground and had to rebuild the package set for GHC 9.2; my script happily told me that cabal was happy with a package set that included linear-base, but the build then proceeded to fail. Seeing it was linear-base I decided to spend a few minutes seeing if I could fix it, and because it was just an import I opened a PR.

I appreciate your arguments, but cabal test succeeds, and if really all that is needed is importing some things from ghc-prim to support 9.2, I'd suggest potentially keeping a few additional users happy.

Copy link
Copy Markdown
Member

@aspiwack aspiwack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fair enough. I'm really surprised that we don't have more incompatibilities with GHC 8.2, though.

@aspiwack aspiwack merged commit 7637761 into tweag:master May 20, 2026
7 checks passed
@tomsmeding tomsmeding deleted the multiplicity-from-ghc-prim branch May 20, 2026 07:01
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.

2 participants