From 2ac92d88dfb9a8864fb619225cb997bd23b1b8e1 Mon Sep 17 00:00:00 2001 From: sof Date: Wed, 1 May 2002 17:56:58 +0000 Subject: [PATCH] [project @ 2002-05-01 17:56:52 by sof] mapM ~> mapM_ --- ghc/compiler/compMan/CmLink.lhs | 2 +- ghc/compiler/ghci/InteractiveUI.hs | 10 +++++----- ghc/compiler/main/Main.hs | 4 ++-- ghc/compiler/usageSP/UsageSPLint.lhs | 6 ++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ghc/compiler/compMan/CmLink.lhs b/ghc/compiler/compMan/CmLink.lhs index 151099b..962c052 100644 --- a/ghc/compiler/compMan/CmLink.lhs +++ b/ghc/compiler/compMan/CmLink.lhs @@ -188,7 +188,7 @@ unload Interactive dflags linkables pls | linkableInSet l linkables = return True | otherwise - = do mapM unloadObj [ f | DotO f <- objs ] + = do mapM_ unloadObj [ f | DotO f <- objs ] return False #else unload Interactive dflags linkables pls = panic "CmLink.unload: no interpreter" diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index d2a96fc..9134440 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,6 +1,6 @@ {-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.123 2002/05/01 15:48:48 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.124 2002/05/01 17:56:54 sof Exp $ -- -- GHC Interactive User Interface -- @@ -797,7 +797,7 @@ setProg _ = do setOptions wds = do -- first, deal with the GHCi opts (+s, +t, etc.) let (plus_opts, minus_opts) = partition isPlus wds - mapM setOpt plus_opts + mapM_ setOpt plus_opts -- now, the GHC flags pkgs_before <- io (readIORef v_Packages) @@ -831,7 +831,7 @@ unsetOptions str then io (putStrLn ("unknown option: `" ++ head rest2 ++ "'")) else do - mapM unsetOpt plus_opts + mapM_ unsetOpt plus_opts -- can't do GHC flags for now if (not (null minus_opts)) @@ -907,7 +907,7 @@ showBindings = do unqual = cmGetPrintUnqual cms showBinding b = putStrLn (showSDocForUser unqual (ppr (ifaceTyThing b))) - io (mapM showBinding (cmGetBindings cms)) + io (mapM_ showBinding (cmGetBindings cms)) return () ----------------------------------------------------------------------------- @@ -1090,7 +1090,7 @@ linkPackage dflags pkg loadDynamics dirs dlls -- After loading all the DLLs, we can load the static objects. - mapM loadObj objs + mapM_ loadObj objs maybePutStr dflags "linking ... " ok <- resolveObjs diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index e53ec3f..0e4910a 100644 --- a/ghc/compiler/main/Main.hs +++ b/ghc/compiler/main/Main.hs @@ -1,7 +1,7 @@ {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.105 2002/05/01 09:30:05 simonmar Exp $ +-- $Id: Main.hs,v 1.106 2002/05/01 17:56:57 sof Exp $ -- -- GHC Driver program -- @@ -308,7 +308,7 @@ main = beginMake :: [String] -> IO () beginMake fileish_args = do let (objs, mods) = partition objish_file fileish_args - mapM (add v_Ld_inputs) objs + mapM_ (add v_Ld_inputs) objs case mods of [] -> throwDyn (UsageError "no input files") diff --git a/ghc/compiler/usageSP/UsageSPLint.lhs b/ghc/compiler/usageSP/UsageSPLint.lhs index 97da3ee..387fb8d 100644 --- a/ghc/compiler/usageSP/UsageSPLint.lhs +++ b/ghc/compiler/usageSP/UsageSPLint.lhs @@ -128,7 +128,7 @@ lintTyUSPAnnotsN fom fex = lintN do { let thelint = if isFunTyCon tc then lintTyUSPAnnots fom fex else lintN - ; mapM thelint tys + ; mapM_ thelint tys ; return () } lintN (FunTy ty1 ty2) = do { lintTyUSPAnnots fom fex ty1 @@ -210,9 +210,7 @@ lintTyUSPConst (TyVarTy _) = do { return () } lintTyUSPConst (AppTy ty1 ty2) = do { lintTyUSPConst ty1 ; lintTyUSPConst ty2 } -lintTyUSPConst (TyConApp tc tys) = do { mapM lintTyUSPConst tys - ; return () - } +lintTyUSPConst (TyConApp tc tys) = mapM_ lintTyUSPConst tys lintTyUSPConst (FunTy ty1 ty2) = do { lintTyUSPConst ty1 ; lintTyUSPConst ty2 } -- 1.7.10.4