on fa9d3bf help sign in
elk/compiler/Model/LoadLibraries.hs
22 lines 600 B history raw
2module LoadLibraries (docs) where
4import Language.Haskell.TH.Syntax
5import Paths_Elm
6import System.Directory
8docs :: Q Exp
9docs = liftString =<< qRunIO readDocs
11readDocs :: IO String
12readDocs = do
13 name <- getDataFileName "docs.json"
14 exists <- doesFileExist name
15 if exists then readFile name
16 else putStrLn warning >> return "{\"modules\":[]}"
18warning = "Warning! Types for standard library not loaded properly!\n\
19 \Run the following commands after compilation:\n\
20 \\n\
21 \ touch compiler/Model/LoadLibraries.hs\n\
22 \ cabal install\n\n"