From 55aebadd5a64eb3f6a566168bbeeeb7cbb4ccb44 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 20 Oct 2014 15:05:43 +0000 Subject: Remove some dead code * The following modules are no longer used and have been removed completely: GF.Compile.Compute.ConcreteLazy GF.Compile.Compute.ConcreteStrict GF.Compile.Refresh * The STM monad has been commented out. It was only used in GF.Compile.SubExpOpt, where could be replaced with a plain State monad, since no error handling was needed. One of the functions was hardwired to the Err monad, but did in fact not use error handling, so it was turned into a pure function. * The function errVal has been renamed to fromErr (since it is analogous to fromMaybe). * Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places. * Some additional old code that was already commented out has been removed. --- 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 e9047b4e7..b0a69019e 100644 --- a/src/compiler/GF/CompileInParallel.hs +++ b/src/compiler/GF/CompileInParallel.hs @@ -66,7 +66,7 @@ batchCompile1 lib_dir (opts,filepaths) = let rel = relativeTo lib_dir cwd prelude_dir = lib_dir"prelude" gfoDir = flag optGFODir opts - maybe (return ()) (D.createDirectoryIfMissing True) gfoDir + maybe done (D.createDirectoryIfMissing True) gfoDir {- liftIO $ writeFile (maybe "" id gfoDir"paths") (unlines . map (unwords . map rel) . nub $ map snd filepaths) @@ -213,14 +213,14 @@ instance (Functor m,Monad m) => Applicative (CollectOutput m) where (<*>) = ap instance Monad m => Monad (CollectOutput m) where - return x = CO (return (return (),x)) + return x = CO (return (done,x)) CO m >>= f = CO $ do (o1,x) <- m let CO m2 = f x (o2,y) <- m2 return (o1>>o2,y) instance MonadIO m => MonadIO (CollectOutput m) where liftIO io = CO $ do x <- liftIO io - return (return (),x) + return (done,x) instance Output m => Output (CollectOutput m) where ePutStr s = CO (return (ePutStr s,())) -- cgit v1.2.3