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

GHC.Vis fails to build with GHC 8.0.1 #15

Open
taktoa opened this issue Oct 16, 2016 · 1 comment
Open

GHC.Vis fails to build with GHC 8.0.1 #15

taktoa opened this issue Oct 16, 2016 · 1 comment

Comments

@taktoa
Copy link

taktoa commented Oct 16, 2016

When compiling with GHC 8.0.1 on NixOS, I have the following problems:

  1. The provided version bounds are too restrictive for my versions of base and transformers.
  2. There are two type errors, labelled Error 1 and Error 2 below, which seem to be result of the ImpredicativeTypes extension used in that file. It seems to me that there are two paths to fixing these errors: either add a type signature to the Nothing on line 228 and to the definition of withPNGSurface, or disable ImpredicativeTypes and fix another error, labelled Error 3 below. If you can compile without ImpredicativeTypes on GHC 7.10, I strongly suspect it will compile on GHC 8.0.1 without modification.

Error 1

src/GHC/Vis.hs:228:16: error:
    • Couldn't match type ‘forall a. Maybe a’ with ‘Maybe String’
      Expected type: IO (Maybe String)
        Actual type: IO (forall a. Maybe a)
    • In a stmt of a 'do' block: return Nothing
      In the expression:
        do { put $ ExportSignal ((\ (Left x) -> x) mbDrawFn) filename;
             return Nothing }
      In a case alternative:
          Left _
            -> do { put $ ExportSignal ((\ (Left x) -> x) mbDrawFn) filename;
                    return Nothing }

Error 2

src/GHC/Vis.hs:233:22: error:
    • Couldn't match type ‘forall a a1 a2.
                           (RealFrac a2, RealFrac a1) =>
                           FilePath -> a1 -> a2 -> (Surface -> IO a) -> IO a’
                     with ‘forall a.
                           FilePath -> Double -> Double -> (Surface -> IO a) -> IO a’
      Expected type: Either
                       (forall a.
                        FilePath -> Double -> Double -> (Surface -> IO a) -> IO a)
                       b
        Actual type: Either
                       (forall a a1 a2.
                        (RealFrac a2, RealFrac a1) =>
                        FilePath -> a1 -> a2 -> (Surface -> IO a) -> IO a)
                       b
    • In the expression: Left withPNGSurface
      In a case alternative: ".png" -> Left withPNGSurface
      In the expression:
        case map toLower (reverse . take 4 . reverse $ filename) of {
          ".svg" -> Left withSVGSurface
          ".pdf" -> Left withPDFSurface
          ".png" -> Left withPNGSurface
          _ : ".ps" -> Left withPSSurface
          _ -> Right
                 "Unknown file extension, try one of the following: .svg, .pdf, .ps, .png" }

Error 3

src/GHC/Vis.hs:569:29: error:
    • Couldn't match type ‘DrawFunction’
                     with ‘FilePath -> Double -> Double -> (Surface -> IO a0) -> IO a0’
      Expected type: View
                     -> (FilePath -> Double -> Double -> (Surface -> IO a0) -> IO a0)
                     -> String
                     -> IO ()
        Actual type: View -> DrawFunction -> String -> IO ()
    • In the first argument of ‘runCorrect’, namely ‘exportView’
      In the first argument of ‘(>>=)’, namely ‘runCorrect exportView’
      In the first argument of ‘catch’, namely
        ‘(runCorrect exportView >>= \ e -> e d f)’
@FranklinChen
Copy link
Contributor

I've already gotten ghc-vis to compile with GHC 8 but the result when run doesn't seem to work (at least on Mac OS X). Can you verify this? https://github.com/FranklinChen/ghc-vis/tree/ghc-8

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

No branches or pull requests

2 participants