compiling-to-categories / concat

Compiling to Categories
http://conal.net/papers/compiling-to-categories
BSD 3-Clause "New" or "Revised" License
431 stars 49 forks source link

Fix GHC-8.10.4 build #72

Closed TristanCacqueray closed 3 years ago

TristanCacqueray commented 3 years ago

This change enables building the graphics example with ghc-8.10.4 and cabal-install-3.4.0.0 with: cabal build -O2 graphics-examples

conal commented 3 years ago

Thanks very much for this contribution.

Is it somehow more relevant to graphics examples than the others?

What motivated you to add an argument to satisy and satisfy'?

TristanCacqueray commented 3 years ago

I meant that I haven't tested the other examples, I just went through the compilation errors until the graphics demo produced the out/shaders/annulus2.html file.

I can't tell why, but adding an argument to satisfy fixed that error:

src/ConCat/Satisfy.hs:17:11: error:
    • Cannot instantiate unification variable ‘a1’
      with a type involving polytypes: (c => z) -> z
        GHC doesn't yet support impredicative polymorphism
    • In the expression:
        error "satisfy: Use -fplugin=ConCat.Satisfy.Plugin"
      In an equation for ‘satisfy’:
          satisfy = error "satisfy: Use -fplugin=ConCat.Satisfy.Plugin"
    • Relevant bindings include
        satisfy :: (c => z) -> z (bound at src/ConCat/Satisfy.hs:17:1)
   |
17 | satisfy = error "satisfy: Use -fplugin=ConCat.Satisfy.Plugin"
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
conal commented 3 years ago

Wow. All of the graphics examples work again. Thanks!!

TristanCacqueray commented 3 years ago

You are welcome, thank you for publishing this project!