From 018c9838ed31571b699118ae75b1d62d5527fd77 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 20 Nov 2013 00:45:33 +0000 Subject: Reduced clutter in monadic code + Eliminated vairous ad-hoc coersion functions between specific monads (IO, Err, IOE, Check) in favor of more general lifting functions (liftIO, liftErr). + Generalized many basic monadic operations from specific monads to arbitrary monads in the appropriate class (MonadIO and/or ErrorMonad), thereby completely eliminating the need for lifting functions in lots of places. This can be considered a small step forward towards a cleaner compiler API and more malleable compiler code in general. --- src/compiler/GF.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/compiler/GF.hs') diff --git a/src/compiler/GF.hs b/src/compiler/GF.hs index 04748b85b..68e43b6ca 100644 --- a/src/compiler/GF.hs +++ b/src/compiler/GF.hs @@ -12,7 +12,6 @@ import Data.Version import System.Directory import System.Environment (getArgs) import System.Exit -import System.IO import GF.System.Console (setConsoleEncoding) main :: IO () @@ -23,8 +22,8 @@ main = do Ok (opts,files) -> do curr_dir <- getCurrentDirectory lib_dir <- getLibraryDirectory opts mainOpts (fixRelativeLibPaths curr_dir lib_dir opts) files - Bad err -> do hPutStrLn stderr err - hPutStrLn stderr "You may want to try --help." + Bad err -> do ePutStrLn err + ePutStrLn "You may want to try --help." exitFailure mainOpts :: Options -> [FilePath] -> IO () -- cgit v1.2.3