[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:05:19 UTC 2010


The following commit has been merged in the master branch:
commit 608a5e419edc05188942a1eb5b6bd62ddfa1904d
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Dec 27 03:12:51 2005 +0100

    Fixed compilation errors

diff --git a/MissingH/Logging/Logger.hs b/MissingH/Logging/Logger.hs
index a96cfb8..ee095d5 100644
--- a/MissingH/Logging/Logger.hs
+++ b/MissingH/Logging/Logger.hs
@@ -181,7 +181,7 @@ import IO
 import System.IO.Unsafe
 import Control.Concurrent.MVar
 import Data.List(map)
-import Data.Map as Map
+import qualified Data.Map as Map
 import qualified Control.Exception
 ---------------------------------------------------------------------------
 -- Basic logger types
@@ -193,7 +193,7 @@ data Logger = Logger { level :: Priority,
                        name :: String}
 
 
-type LogTree = Map String Logger
+type LogTree = Map.Map String Logger
 
 {- | This is the base class for the various log handlers.  They should
 all adhere to this class. -}
@@ -323,12 +323,12 @@ getLogger lname = modifyMVar logTree $ \lt ->
          Nothing -> do
                     --print "Missed it."
                     -- Add it.  Then call myself to retrieve it.
-                    newlt <- createLoggers (componentsOfName lname) lt
+                    let newlt = createLoggers (componentsOfName lname) lt
                     --putStrLn "createLoggers done"
-                    logger <- getLogger lname
-                    return (newlt, logger)
-    where createLoggers :: [String] -> LogTree -> IO ()
-          createLoggers [] lt = return lt
+                    result <- Map.lookup lname newlt
+                    return (newlt, result)
+    where createLoggers :: [String] -> LogTree -> LogTree
+          createLoggers [] lt = lt
           createLoggers (x:xs) lt =
               if Map.member x lt
                  then createLoggers xs lt
@@ -403,7 +403,8 @@ setLevel p l = l{level = p}
 -- account any changes you may have made.
 
 saveGlobalLogger :: Logger -> IO ()
-saveGlobalLogger l = modifyMVar_ logTree (\lt -> Map.insert (name l) l lt)
+saveGlobalLogger l = modifyMVar_ logTree 
+                     (\lt -> return $ Map.insert (name l) l lt)
 
 {- | Helps you make changes on the given logger.  Takes a function
 that makes changes and writes those changes back to the global

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list