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/CompileOne.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/compiler/GF/CompileOne.hs') diff --git a/src/compiler/GF/CompileOne.hs b/src/compiler/GF/CompileOne.hs index 8c68f013a..17ef93935 100644 --- a/src/compiler/GF/CompileOne.hs +++ b/src/compiler/GF/CompileOne.hs @@ -21,7 +21,7 @@ import GF.Grammar.Binary(decodeModule,encodeModule) import GF.Infra.Option import GF.Infra.UseIO(FullPath,IOE,isGFO,gf2gfo,MonadIO(..),Output(..),putPointE) import GF.Infra.CheckM(runCheck') -import GF.Data.Operations(ErrorMonad,liftErr,(+++)) +import GF.Data.Operations(ErrorMonad,liftErr,(+++),done) import GF.System.Directory(doesFileExist,getCurrentDirectory,renameFile) import qualified Data.Map as Map @@ -62,7 +62,7 @@ reuseGFO opts srcgr file = if flag optTagsOnly opts then writeTags opts srcgr (gf2gftags opts file) sm1 - else return () + else done return (Just file,sm) @@ -132,7 +132,7 @@ compileSourceModule opts cwd mb_gfFile gr = idump opts pass (dump out) return (ret out) - maybeM f = maybe (return ()) f + maybeM f = maybe done f --writeGFO :: Options -> FilePath -> SourceModule -> IOE () @@ -151,12 +151,12 @@ writeGFO opts file mo = --intermOut :: Options -> Dump -> Doc -> IOE () intermOut opts d doc | dump opts d = ePutStrLn (render ("\n\n--#" <+> show d $$ doc)) - | otherwise = return () + | otherwise = done idump opts pass = intermOut opts (Dump pass) . ppModule Internal warnOut opts warnings - | null warnings = return () + | null warnings = done | otherwise = do ePutStr "\ESC[34m";ePutStr ws;ePutStrLn "\ESC[m" where ws = if flag optVerbosity opts == Normal -- cgit v1.2.3