You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling with GHC 8.0.1 on NixOS, I have the following problems:
The provided version bounds are too restrictive for my versions of base and transformers.
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)’
The text was updated successfully, but these errors were encountered:
When compiling with GHC 8.0.1 on NixOS, I have the following problems:
base
andtransformers
.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 theNothing
on line 228 and to the definition ofwithPNGSurface
, or disableImpredicativeTypes
and fix another error, labelled Error 3 below. If you can compile withoutImpredicativeTypes
on GHC 7.10, I strongly suspect it will compile on GHC 8.0.1 without modification.Error 1
Error 2
Error 3
The text was updated successfully, but these errors were encountered: