@@ -26,7 +26,7 @@ import Data.Maybe (mapMaybe)
2626import Data.Traversable (traverse)
2727
2828import System.Console.Haskeline
29−import System.Directory (createDirectoryIfMissing, findExecutable)
29+import System.Directory (findExecutable)
3030import System.Exit
3131import System.Environment.XDG.BaseDir
3232import System.Process
@@ -36,9 +36,16 @@ import qualified Paths_purescript as Paths
3636import qualified System.IO.UTF8 as U (readFile)
3737import qualified Text.Parsec as Parsec (eof)
3838
39+getHistoryFilename :: IO FilePath
40+getHistoryFilename = getUserConfigFile "purescript" "psci_history"
41+
3942getPreludeFilename :: IO FilePath
4043getPreludeFilename = Paths.getDataFileName "prelude/prelude.purs"
4144
45+findNodeProcess :: IO (Maybe String)
46+findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
47+ where names = ["nodejs", "node"]
48+
4249options :: P.Options
4350options = P.Options True False True (Just "Main") True "PS" []
4451
@@ -117,16 +124,6 @@ loadModule moduleFile = do
117124 moduleText <- U.readFile moduleFile
118125 return . either (Left . show) Right $ P.runIndentParser "" P.parseModules moduleText
119126
120−findNodeProcess :: IO (Maybe String)
121−findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
122− where names = ["nodejs", "node"]
123−
124−getHistoryFilename :: IO FilePath
125−getHistoryFilename = do
126− purescriptConfig <- getUserConfigDir "purescript"
127− createDirectoryIfMissing True purescriptConfig
128− getUserConfigFile "purescript" "psci_history"
129−
130127main :: IO ()
131128main = do
132129 preludeFilename <- getPreludeFilename