git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Load unconditionally the content of the file extern.purs for the current

loaded module.

commit098cee6a9f4038e0ff1098c08f152dcfc16c6b30 authorAntoine R. Dumont <antoine.romain.dumont@gmail.com> dateThu 30 Oct 2014, 23:39 (12 years ago) parent2d9c8a1
1 file changed+16−1
psci/Main.hs+16−1
psci/Main.hs+16−1
@@ -54,6 +54,7 @@ import qualified Language.PureScript as P
5454import qualified Paths_purescript as Paths
5555import qualified System.IO.UTF8 as U
5656 (writeFile, putStrLn, print, readFile)
57+import qualified Language.PureScript.Names as N
5758
5859-- |
5960-- The PSCI state.
@@ -316,8 +317,22 @@ handleImport moduleName = do
316317 PSCI $ lift $ put s
317318 return ()
318319
320+-- |
321+-- Compute the file `extern.purs` for the module moduleName.
322+--
323+externPursFile :: FilePath -> FilePath
324+externPursFile moduleName = modulesDir ++ pathSeparator : moduleName ++ pathSeparator : "externs.purs"
325+
326+-- |
327+-- Browse and display the module's function signatures
328+-- readFile :: FilePath -> IO String
329+--
319330handleBrowse :: P.ModuleName -> PSCI ()
320−handleBrowse moduleName = undefined
331+handleBrowse moduleName = do
332+ st <- PSCI $ lift get
333+ psciIO $ (readFile . externPursFile . N.runModuleName) moduleName >>= putStrLn
334+ PSCI $ lift $ put st
335+ return ()
321336
322337-- |
323338-- Takes a value and prints its type