@@ -23,26 +23,27 @@ loadInterface filePath = do
23 return $ Right byteString
23 return $ Right byteString
26− return $ Left $ "Unable to find file " ++ filePath ++
26+ return $ Left $ "Unable to find file " ++ filePath ++
27− " for deserialization!"
27+ " for deserialization!"
29−interfaceDecode :: Binary.Binary a => FilePath -> L.ByteString ->
29+interfaceDecode :: Binary.Binary a =>
30− Either String a
30+ FilePath -> L.ByteString -> Either String a
31interfaceDecode filePath bytes = do
31interfaceDecode filePath bytes = do
32 case Binary.decodeOrFail bytes of
32 case Binary.decodeOrFail bytes of
33− Left (_, offset, err) -> do
34− Left $ "Got an error, '" ++ err ++ "' at offset " ++
35− show offset ++ " of " ++ filePath ++ ".\n\n" ++
36− "This error may be due to an outdated or corrupt " ++
37− "artifact from a previous build. Please rebuild " ++
38− filePath ++ " and try again."
40 Right (_, _, binaryInfo) -> Right binaryInfo
33 Right (_, _, binaryInfo) -> Right binaryInfo
35+ Left (_, offset, err) ->
36+ Left $ concat [ "Got an error, '" ++ err ++ "' at offset "
37+ , show offset ++ " of " ++ filePath ++ ".\n\n"
38+ , "This error may be due to an outdated or corrupt "
39+ , "artifact from a previous build. Please rebuild "
40+ , filePath ++ " and try again."
42validVersion :: FilePath -> (String, ModuleInterface) ->
43validVersion :: FilePath -> (String, ModuleInterface) ->
43 Either String (String, ModuleInterface)
44 Either String (String, ModuleInterface)
44validVersion filePath (name, interface) =
45validVersion filePath (name, interface) =
45− if (iVersion interface) == showVersion version then
46+ if iVersion interface == showVersion version then
46 Right (name, interface)
47 Right (name, interface)
48 Left $ "Found build artifacts created by a different " ++
49 Left $ "Found build artifacts created by a different " ++