From c707575bd7751ac3b03371edba478e37d3488448 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 10 Nov 2014 16:20:01 +0000 Subject: Documentation improvements and cleanup relating to the IOE monad Renamed appIOE to tryIOE (it is analogous to 'try' in the standard libraries). Removed unused IOE operations & documented the remaining ones. Removed/simplified superfluous uses of IOE operations. --- src/compiler/GF/CompileInParallel.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/compiler/GF/CompileInParallel.hs') diff --git a/src/compiler/GF/CompileInParallel.hs b/src/compiler/GF/CompileInParallel.hs index 22a53a841..48e5821b0 100644 --- a/src/compiler/GF/CompileInParallel.hs +++ b/src/compiler/GF/CompileInParallel.hs @@ -81,11 +81,11 @@ batchCompile1 lib_dir (opts,filepaths) = takeFileName f `elem` prelude_files ppPath ps = "-path="<>intercalate ":" (map rel ps) deps <- newMVar M.empty - toLog <- newLog runIOE + toLog <- newLog id term <- getTermColors let --logStrLn = toLog . ePutStrLn --ok :: CollectOutput IO a -> IO a - ok (CO m) = err bad good =<< appIOE m + ok (CO m) = err bad good =<< tryIOE m where good (o,r) = do toLog o; return r bad e = do toLog (redPutStrLn e); fail "failed" @@ -98,7 +98,7 @@ batchCompile1 lib_dir (opts,filepaths) = -- logStrLn $ "Finished "++show (length (modules gr'))++" modules." return gr' fcache <- liftIO $ newIOCache $ \ _ (imp,Hide (f,ps)) -> - do (file,_,_) <- runIOE $ findFile gfoDir ps imp + do (file,_,_) <- findFile gfoDir ps imp return (file,(f,ps)) let find f ps imp = do (file',(f',ps')) <- liftIO $ readIOCache fcache (imp,Hide (f,ps)) -- cgit v1.2.3