@@ -1,13 +1,22 @@
2−module LoadLibraries where
2+module LoadLibraries (docs) where
4import Language.Haskell.TH.Syntax
4import Language.Haskell.TH.Syntax
5import Paths_Elm
5import Paths_Elm
6+import System.Directory
7docs :: Q Exp
8docs :: Q Exp
8−docs = liftString =<< qRunIO (do
9+docs = liftString =<< qRunIO readDocs
9− s <- readFile =<< getDataFileName "docs.json"
13+ name <- getDataFileName "docs.json"
14+ exists <- doesFileExist name
15+ if exists then readFile name
16+ else putStrLn warning >> return "{\"modules\":[]}"
18+warning = "Warning! Types for standard library not loaded properly!\n\
19+ \Run the following commands after compilation:\n\
21+ \ touch compiler/Model/LoadLibraries.hs\n\