:set +m :set -package ghc :module + System.Directory :module + System.Environment :module + System.IO :module + Control.Monad :module + Data.List let llM :: IO String llM = do e <- System.Environment.getEnvironment case lookup "GHCI_LOAD" e of Nothing -> return "" Just f -> do putStrLn $ "LOADING " ++ f return $ ":load " ++ f let sourceGHCI :: String -> IO String sourceGHCI f = do b <- doesFileExist f when b $ putStrLn $ "SOURCING " ++ f if b then readFile f else return "" let commands :: [IO String] -> IO String commands = liftM (intercalate "\n") . sequence :def init (const $ commands [sourceGHCI ".extensions.ghci", sourceGHCI ".ghc_options.ghci"]) :def ll (const $ commands [llM, sourceGHCI ".reload.ghci"]) :def rl (const $ commands [return ":re", sourceGHCI ".reload.ghci"]) :init :ll :module - System.Directory :module - System.Environment :module - System.IO :module - Control.Monad :module - Data.List