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

Fix ghc Monoid/Semigroup Issue for cabal-based builds with newer versions of base #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dansvo
Copy link

@dansvo dansvo commented Nov 24, 2019

I'm playing around with this package in a project that generates OpenSCAD geometries from Haskell. I found that when running cabal v2-build on a project which includes this package, ghc pukes:

Graphics/OpenSCAD.hs:622:10: error:
     Could not deduce (Semigroup (Model v))
        arising from the superclasses of an instance declaration
      from the context: Vector v
        bound by the instance declaration at Graphics/OpenSCAD.hs:622:10-37
     In the instance declaration for Monoid (Model v)
    |
622 | instance Vector v => Monoid (Model v) where
    |   

Looks like the Monoid instance in OpenSCAD.hs predates the split in base from a single Monoid typeclass (base < 4.11) which has both mappend and mempty to separate Monoid and Semigroup classes (base >=4.11) for these two functions. Currently, cabal selects base-4.12.0.0, given the constraints in OpenSCAD.cabal.

I was able to fix this for my project by defining separate Semigroup and Monoid instances for Model in 8405259. This could probably also be fixed by constraining base < 4.11 in OpenSCAD.cabal.

…t explicitely call for a version of base which predates the semigroup/monoid split
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