Twinside / Rasterific

A drawing engine in Haskell
BSD 3-Clause "New" or "Revised" License
140 stars 11 forks source link

Does not build with GHC 9.0 #59

Closed lrworth closed 3 years ago

lrworth commented 3 years ago

I don't understand what's going on well enough to debug this myself, but it could be related to https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0287-simplify-subsumption.rst.

$ cabal build
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
 - Rasterific-0.7.5.3 (lib) (file src/Graphics/Rasterific/MicroPdf.hs changed)
 - Rasterific-0.7.5.3 (exe:rastertest) (dependency rebuilt)
 - Rasterific-0.7.5.3 (exe:doc_builder) (dependency rebuilt)
Preprocessing library for Rasterific-0.7.5.3..
Building library for Rasterific-0.7.5.3..

on the commandline: warning:
    -Wnoncanonical-monadfail-instances is deprecated: fail is no longer a method of Monad
[27 of 29] Compiling Graphics.Rasterific.MicroPdf ( src/Graphics/Rasterific/MicroPdf.hs, /Users/lukeworth/bump-diagrams/Rasterific/dist-newstyle/build/x86_64-osx/ghc-9.0.1/Rasterific-0.7.5.3/build/Graphics/Rasterific/MicroPdf.o, /Users/lukeworth/bump-diagrams/Rasterific/dist-newstyle/build/x86_64-osx/ghc-9.0.1/Rasterific-0.7.5.3/build/Graphics/Rasterific/MicroPdf.dyn_o )

src/Graphics/Rasterific/MicroPdf.hs:1139:25: error:
    • Couldn't match type ‘InnerRenderer’
                     with ‘m0 () -> [DrawOrder px]’
      Expected: PdfConfiguration -> m0 () -> [DrawOrder px]
        Actual: PdfConfiguration -> InnerRenderer
    • In the first argument of ‘asks’, namely ‘_pdfConfToOrder’
      In a stmt of a 'do' block: toOrders <- asks _pdfConfToOrder
      In the expression:
        do toOrders <- asks _pdfConfToOrder
           let orders :: [DrawOrder px]
               orders = toOrders . liftF $ SetTexture prevTexture subDrawings ()
               ....
           after <- recurse next
           this <- recurse . fromF $ F.fold placedDrawings
           ....
    • Relevant bindings include
        next :: Free (DrawCommand px) ()
          (bound at src/Graphics/Rasterific/MicroPdf.hs:1138:48)
        subDrawings :: Drawing px ()
          (bound at src/Graphics/Rasterific/MicroPdf.hs:1138:36)
        recurse :: Free (DrawCommand px) () -> PdfEnv Builder
          (bound at src/Graphics/Rasterific/MicroPdf.hs:1154:7)
        com :: DrawCommand px (Free (DrawCommand px) ())
          (bound at src/Graphics/Rasterific/MicroPdf.hs:1049:50)
        prevTexture :: Texture px
          (bound at src/Graphics/Rasterific/MicroPdf.hs:1049:38)
        go :: Bool
              -> Transformation
              -> (FillMethod -> Builder)
              -> Texture px
              -> DrawCommand px (Free (DrawCommand px) ())
              -> PdfEnv Builder
          (bound at src/Graphics/Rasterific/MicroPdf.hs:1049:3)
     |
1139 |        toOrders <- asks _pdfConfToOrder
     |                         ^^^^^^^^^^^^^^^
cabal: Failed to build Rasterific-0.7.5.3 (which is required by exe:rastertest
from Rasterific-0.7.5.3 and exe:doc_builder from Rasterific-0.7.5.3)
lrworth commented 3 years ago

@endgame helped me fix this up :)