@@ -17,15 +17,14 @@
1717{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1818{-# LANGUAGE RecordWildCards #-}
1919{-# LANGUAGE TupleSections #-}
20−{-# LANGUAGE CPP #-}
2120
2221module PSCi where
2322
23+import Prelude ()
24+import Prelude.Compat
25+
2426import Data.Foldable (traverse_)
2527import Data.List (intercalate, nub, sort)
26−#if __GLASGOW_HASKELL__ < 710
27−import Data.Traversable (traverse)
28−#endif
2928import Data.Tuple (swap)
3029import Data.Version (showVersion)
3130import qualified Data.Map as M
@@ -507,7 +506,7 @@ loadUserConfig = onFirstFileMatching readCommands pathGetters
507506 if exists
508507 then do
509508 ls <- lines <$> readFile configFile
510− case mapM parseCommand ls of
509+ case traverse parseCommand ls of
511510 Left err -> print err >> exitFailure
512511 Right cs -> return $ Just cs
513512 else
@@ -524,8 +523,8 @@ consoleIsDefined = any ((== P.ModuleName (map P.ProperName [ "Control", "Monad",
524523loop :: PSCiOptions -> IO ()
525524loop PSCiOptions{..} = do
526525 config <- loadUserConfig
527− inputFiles <- concat <$> mapM glob psciInputFile
528− foreignFiles <- concat <$> mapM glob psciForeignInputFiles
526+ inputFiles <- concat <$> traverse glob psciInputFile
527+ foreignFiles <- concat <$> traverse glob psciForeignInputFiles
529528 modulesOrFirstError <- loadAllModules inputFiles
530529 case modulesOrFirstError of
531530 Left errs -> putStrLn (P.prettyPrintMultipleErrors False errs) >> exitFailure
@@ -540,7 +539,7 @@ loop PSCiOptions{..} = do
540539 Right foreigns ->
541540 flip evalStateT (PSCiState inputFiles [] modules foreigns [] psciInputNodeFlags) . runInputT (setComplete completion settings) $ do
542541 outputStrLn prologueMessage
543− traverse_ (mapM_ (runPSCI . handleCommand)) config
542+ traverse_ (traverse_ (runPSCI . handleCommand)) config
544543 modules' <- lift $ gets psciLoadedModules
545544 unless (consoleIsDefined (map snd modules')) . outputStrLn $ unlines
546545 [ "PSCi requires the purescript-console module to be installed."