3module LoadLibraries (docs) where
5import Language.Haskell.TH.Syntax
11docs = liftString =<< qRunIO (readDocs dataDir)
13-- When compiling elm (library and executable), docs.json isn't (yet) in the standard location
14-- Therefore, Elm.cabal overrides the location.
15-- Since this is only used by the TemplateHaskell, which reads the file at compile time,
19#if defined ELM_COMPILEDATADIR
20dataDir = canonicalizePath (ELM_COMPILEDATADIR </> "docs.json")
22dataDir = getDataFileName "docs.json"
25readDocs :: IO FilePath -> IO String
28 exists <- doesFileExist name
29 if exists then readFile name
30 else putStrLn warning >> return "{\"modules\":[]}"
32warning = "Warning! Types for standard library not loaded properly!\n\
33 Run the following commands after compilation:\n\
35 touch compiler/Model/LoadLibraries.hs\n\
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list