on master help sign in
Stop trying to load interfaces when adding the prelude
commitc7de365716869ff69d31a5fc41b1b9f7ccd7a038 authorEvan Czaplicki <info@elm-lang.org> dateTue 14 Oct 2014, 17:42 (12 years ago) parent458799a
1 file changed+1−37
compiler/Metadata/Prelude.hs+1−37
compiler/Metadata/Prelude.hs+1−37
@@ -1,16 +1,12 @@
11{-# OPTIONS_GHC -W #-}
22{-# LANGUAGE FlexibleContexts #-}
3−module Metadata.Prelude (interfaces, add) where
3+module Metadata.Prelude (add) where
44
5−import Control.Monad.Error (MonadError, throwError, MonadIO, liftIO)
65import qualified Data.Map as Map
76import qualified Data.Set as Set
87
98import qualified AST.Module as Module
109import qualified AST.Variable as Var
11−import qualified Build.Artifact as Artifact
12−import qualified Build.Utils as Utils
13−import qualified Elm.Compiler.Version as Compiler
1410
1511
1612-- DEFINITION OF THE PRELUDE
@@ -97,35 +93,3 @@ addImport (name, method) importDict =
9793 Var.Listing
9894 (Set.toList (Set.fromList (explicits1 ++ explicits2)))
9995 (open1 || open2)
100−
101−
102−-- EXTRACT INTERFACES FROM STATIC FILE
103−
104−interfaces :: (MonadIO m, MonadError String m) => m Module.Interfaces
105−interfaces =
106− do filePath <- liftIO (Utils.getDataFile "interfaces.data")
107− interfaces <- mapM (isValid filePath) =<< Artifact.read filePath
108− case interfaces of
109− [] -> throwError "No interfaces found in serialized Prelude!"
110− _ -> return (Map.fromList interfaces)
111−
112−
113−isValid
114− :: (MonadError String m)
115− => FilePath
116− -> (Module.Name, Module.Interface)
117− -> m (Module.Name, Module.Interface)
118−isValid filePath (name, interface) =
119− if version == Compiler.version
120− then return (name, interface)
121− else throwError badVersion
122− where
123− version = Module.iVersion interface
124−
125− badVersion =
126− concat
127− [ "Error reading build artifact: ", filePath, "\n"
128− , " It was generated by version ", version, " of the compiler,\n"
129− , " but you are using version ", Compiler.version, "\n"
130− , " Please remove the file and try again.\n"
131− ]