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

CarpHask fails to build with hashable >= 1.4 (GHC 9.2 / Stackage LTS-20) #1448

Closed
sternenseemann opened this issue Dec 22, 2022 · 4 comments · Fixed by #1449
Closed

CarpHask fails to build with hashable >= 1.4 (GHC 9.2 / Stackage LTS-20) #1448

sternenseemann opened this issue Dec 22, 2022 · 4 comments · Fixed by #1449

Comments

@sternenseemann
Copy link

Building library for CarpHask-0.5.5.0..
[ 1 of 53] Compiling Map              ( src/Map.hs, dist/build/Map.o, dist/build/Map.dyn_o )
[ 2 of 53] Compiling Set              ( src/Set.hs, dist/build/Set.o, dist/build/Set.dyn_o )
[ 3 of 53] Compiling Util             ( src/Util.hs, dist/build/Util.o, dist/build/Util.dyn_o )
[ 4 of 53] Compiling SymPath          ( src/SymPath.hs, dist/build/SymPath.o, dist/build/SymPath.dyn_o )
[ 5 of 53] Compiling Types            ( src/Types.hs, dist/build/Types.o, dist/build/Types.dyn_o )
[ 6 of 53] Compiling TypesToC         ( src/TypesToC.hs, dist/build/TypesToC.o, dist/build/TypesToC.dyn_o )
[ 7 of 53] Compiling TypePredicates   ( src/TypePredicates.hs, dist/build/TypePredicates.o, dist/build/TypePredicates.dyn_o )
[ 8 of 53] Compiling Path             ( src/Path.hs, dist/build/Path.o, dist/build/Path.dyn_o )
[ 9 of 53] Compiling Info             ( src/Info.hs, dist/build/Info.o, dist/build/Info.dyn_o )
[10 of 53] Compiling Project          ( src/Project.hs, dist/build/Project.o, dist/build/Project.dyn_o )
[11 of 53] Compiling Obj              ( src/Obj.hs, dist/build/Obj.o, dist/build/Obj.dyn_o )

src/Obj.hs:1011:10: error:
    • No instance for (Eq Context)
        arising from the superclasses of an instance declaration
    • In the instance declaration for ‘Hashable Context’
     |
1011 | instance Hashable Context where
     |          ^^^^^^^^^^^^^^^^
[35 of 53] Compiling ColorText        ( src/ColorText.hs, dist/build/ColorText.o, dist/build/ColorText.dyn_o )

The cause is probably hashable-1.4.0.0 which changed the following:

Eq is now a superclass of Hashable. Also Eq1 is a superclass of Hashable1 and Eq2 is a superclass of Hashable2 when exists.

@eriksvedang
Copy link
Collaborator

Thanks for reporting! Do you have a suggestion for what the correct fix is?

@scolsen
Copy link
Contributor

scolsen commented Dec 22, 2022

Looks like we'd need to declare an instance Eq Context or just derive Eq

@scolsen
Copy link
Contributor

scolsen commented Dec 22, 2022

So I fixed that, but there are further issues. We have a lot of "uni patterns" in let bindings let (FooData x y) = which we don't permit because we compile w/ exhaustive pattern checking, so we'll have to fix all those too. I'm guessing the prior version of GHC we were using didn't apply this check to let bindings or something.

@scolsen
Copy link
Contributor

scolsen commented Dec 22, 2022

see #1449 for a fix. let's see if the tests pass, though. it required touching a lot of code

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 a pull request may close this issue.

3 participants