diff --git a/tower-aadl/src/Tower/AADL.hs b/tower-aadl/src/Tower/AADL.hs index 3cd31dd..d4bbadd 100644 --- a/tower-aadl/src/Tower/AADL.hs +++ b/tower-aadl/src/Tower/AADL.hs @@ -28,7 +28,6 @@ import Control.Monad hiding (forever) import System.FilePath (addExtension, takeFileName, (<.>)) import System.IO (hPutStrLn, stderr) import System.Exit (exitFailure) -import MonadLib (runWriterT) import Text.PrettyPrint.Leijen hiding (()) import qualified Text.PrettyPrint @@ -110,16 +109,19 @@ compileTowerAADLForPlatform fromEnv mkEnv twr' = do unless (validCIdent appname) $ error $ "appname must be valid c identifier; '" ++ appname ++ "' is not" - (cmodules, errors) <- runWriterT $ O.compileUnits mods copts + (ecmodules, errors) <- O.compileUnits mods copts hPutStrLn stderr . Text.PrettyPrint.render $ Text.PrettyPrint.vcat errors - let (appMods, libMods) = - partition (\m -> O.unitName m `elem` pkgs) cmodules - O.outputCompiler appMods (as osspecific) (osSpecificOptsApps osspecific cfg copts) - O.outputCompiler libMods [] (osSpecificOptsLibs osspecific cfg copts) + case ecmodules of + Left errs -> error $ show errs + Right cmodules -> do + let (appMods, libMods) = + partition (\m -> O.unitName m `elem` pkgs) cmodules + O.outputCompiler appMods (as osspecific) (osSpecificOptsApps osspecific cfg copts) + O.outputCompiler libMods [] (osSpecificOptsLibs osspecific cfg copts) where -- | AADL assumes that our handlers will always have a callback define. So we diff --git a/tower-aadl/tower-aadl.cabal b/tower-aadl/tower-aadl.cabal index 29787e5..a8f5089 100644 --- a/tower-aadl/tower-aadl.cabal +++ b/tower-aadl/tower-aadl.cabal @@ -29,7 +29,6 @@ library , containers , directory , filepath - , monadLib >= 3.7 , pretty >= 1.1 , wl-pprint , ivory >= 0.1.0.2 diff --git a/tower-mini/src/Tower/Mini.hs b/tower-mini/src/Tower/Mini.hs index 8857bd4..00fcc58 100644 --- a/tower-mini/src/Tower/Mini.hs +++ b/tower-mini/src/Tower/Mini.hs @@ -243,15 +243,18 @@ compileTowerMini _fromEnv mkEnv comps = do , outHdrDir = Just (f name "include") , outArtDir = Just (f name) } - (cmodules, errors) <- runWriterT $ compileUnits mods copts' + (ecmodules, errors) <- compileUnits mods copts' hPutStrLn stderr $ render $ vcat errors - let (appMods, libMods) = - partition (\m -> unitName m `elem` packages) cmodules - libAs = dependencies_artifacts deps + case ecmodules of + Left errs -> error $ show errs + Right cmodules -> do + let (appMods, libMods) = + partition (\m -> unitName m `elem` packages) cmodules + libAs = dependencies_artifacts deps - outputCompiler appMods libAs copts' - outputCompiler libMods [] copts' + outputCompiler appMods libAs copts' + outputCompiler libMods [] copts' -- | Build an individual minitower component. This is where much of -- the action is, as we finally run the underlying 'Tower' program of