[pull IO into LM, added timing
martin.hofmann@uni-bamberg.de**20090624104257] hunk ./src/Data/HypoSpace.hs 162
-    in  h `seq` hsp{hypoIdBimap = f h him} 
+    in  hsp{hypoIdBimap = f h him} 
hunk ./src/Data/HypoSpace.hs 171
-        | otherwise                              =
-            incrementHypoCount $                     -- finally
-            alterRateIdsMap  (addToBin iD)      h $! -- third
-            alterRuleIdsMap  (addToBin iD)      h $! -- second
-            alterHypoIdBimap (flip B.insert iD) h $! -- first
+        | otherwise                              = 
+            incrementHypoCount $                      -- finally
+            alterRateIdsMap  (addToBin iD)      h $  -- third
+            alterRuleIdsMap  (addToBin iD)      h $  -- second
+            alterHypoIdBimap (flip B.insert iD) h $  -- first
hunk ./src/Data/IOData.hs 145
-fuse :: [CovrRule] -> CovrRule
-fuse cruls = 
+fuse :: [CovrRule] ->  LM CovrRule
+fuse cruls = do
+    rule <- antiunifyRules rules
+    let opos         = openPositions rule
hunk ./src/Data/IOData.hs 150
-      then RF n rule indices opos
-      else error $ "Data.IOData.fuse : Cannot fuse CovrRules with different names!"
+      then return $  RF n rule indices opos
+      else fail $ "Data.IOData.fuse : Cannot fuse CovrRules with different names!"
hunk ./src/Data/IOData.hs 155
-    rule         = unLM $ antiunifyRules rules
-    opos         = openPositions rule
+--    rule         = unLM $ antiunifyRules rules
+--    opos         = openPositions rule
hunk ./src/Data/IgorMonad.hs 10
-    targets, addIO, breakupM, fuseM, coverAll, evalIO,
+    targets, addIO, breakupM, coverAll, evalIO,
hunk ./src/Data/IgorMonad.hs 56
-setTarget n = do
-    igor <- get
-    let igor' = setupTarget n igor
-    put igor'
+setTarget n = get >>= lift . (setupTarget n) >>= put
hunk ./src/Data/IgorMonad.hs 67
-setupTarget :: Name -> Igor -> Igor
-setupTarget n ( Igor iod _ lc cf) = 
-    Igor iod (initHSpace (fuse . (getAll n) $ iod)) ((n,0):lc) cf  
+setupTarget :: Name -> Igor -> LM Igor
+setupTarget n ( Igor iod _ lc cf) = do
+    initH <- fuse . (getAll n) $ iod
+    return $ Igor iod (initHSpace initH) ((n,0):lc) cf  
hunk ./src/Data/IgorMonad.hs 175
-fuseM :: [CovrRule] -> IM CovrRule  
-fuseM = return . fuse
+--fuseM :: [CovrRule] -> IM CovrRule  
+--fuseM = return . fuse
hunk ./src/Data/IgorMonad.hs 179
-coverAll n = gets iodata >>= return.getAll n >>= fuseM
+coverAll n = gets iodata >>= lift . fuse . (getAll n)
hunk ./src/Data/Rules.hs 179
-        (r:l) <- mapM antiunify (rhss:tlhss)
---        (left,right)<-  antiunify2 tlhss rhss id
+--        (r:l) <- mapM antiunify (rhss:tlhss)
+        (l,r)<-  antiunify2 tlhss rhss id
hunk ./src/RuleDevelopment/Matching.hs 154
-    subinis       <- mapM (\n -> liftM (fuse.(getAll n)) getEvidence) subfns
+    subinis       <- mapM coverAll subfns
hunk ./src/RuleDevelopment/Partition.hs 20
-    fusedrest    <- return $ fuse rest
+    fusedrest    <- lift $ fuse rest
hunk ./src/RuleDevelopment/Partition.hs 46
-    return $ S.fromList $ map fuse bins
+    liftM  S.fromList $ mapM fuse bins
hunk ./src/Syntax/Antiunifier.hs 10
---        antiunifyWithMap, -- ::  (Antiunifiable k v t) => (VarMap k v) -> [t] -> LM t
---        antiunify2,        -- :: (Antiunifiable k v t') => [[t]] -> [t'] -> LM ([t],t')
+        antiunifyWithMap, -- ::  (Antiunifiable k v t) => (VarMap k v) -> [t] -> LM t
+        antiunify2,        -- :: (Antiunifiable k v t') => [[t]] -> [t'] -> LM ([t],t')
hunk ./src/Syntax/Antiunifier.hs 91
---    -- | Same as 'antiunify' but uses a 'VarMap' as initial state
---    antiunifyWithMap ::  (Antiunifiable t, Monad m) => (VarMap t) -> [t] -> m t
---    antiunifyWithMap  = (\m t -> evalAU (aunify t) m)
+    -- | Same as 'antiunify' but uses a 'VarMap' as initial state
+    antiunifyWithMap ::  (Antiunifiable t, Monad m) => (VarMap t) -> [t] -> m t
+    antiunifyWithMap  = (\m t -> evalAU (aunify t) m)
hunk ./src/Syntax/Antiunifier.hs 103
---    antiunify2        :: (Ord t', Antiunifiable t', Antiunifiable t, Monad m) 
---                      => [[t]] -> [t'] -> (t -> t') -> m ([t],t')
---    antiunify2 ts ts' trans = do
---            (ait,varmap) <- runAU ((mapM aunify) ts) M.empty
---            ait'         <- antiunifyWithMap (M.mapKeys (map trans) varmap) ts'
---            return (ait,ait')   
+    antiunify2        :: (Ord t', Antiunifiable t', Antiunifiable t, Monad m) 
+                      => [[t]] -> [t'] -> (t -> t') -> m ([t],t')
+    antiunify2 ts ts' trans = do
+            (ait,varmap) <- runAU ((mapM aunify) ts) M.empty
+            ait'         <- antiunifyWithMap (M.mapKeys (map trans) varmap) ts'
+            return (ait,ait')   
hunk ./src/Syntax/Types.hs 133
-    | otherwise = ty 
-    
+    | otherwise = ty     
hunk ./src/Syntax/Types.hs 139
-    f done e =
-        case e of
-            (ForallT ns cxt t) -> map (addPredicates cxt) $ f done t
-            (AppT e1 e2)       -> f (e2:done) e1
-            _owise             -> e:done
+    f done (ForallT ns cxt t) = map (addPredicates cxt) $ f done t
+    f done (AppT e1 e2)       = f (e2:done) e1
+    f done e                  = e:done
hunk ./src/UI/UIStarter.hs 270
-time :: IO a -> IO (String, a)
+time :: IO a -> IO (a, Doc)
hunk ./src/UI/UIStarter.hs 277
-    return (printf "CPU time: %6.5fs\n" t, a)
+    return $ (a , text (printf "%6.5fs" t) <>linebreak)
hunk ./src/UI/UIStarter.hs 294
-    let res = resToDoc w r
-    hPutDoc stdout $ introBanner <$$> pretty c <$$> outroBanner <$$> res
+    let res = resToDoc w t r
+    hPutDoc stdout $ introBanner <$$> pretty c <$$> res
hunk ./src/UI/UIStarter.hs 297
-                     pretty l <$$> resBanner w <$$> outroBanner <$$> res -- <$$> text t
+                     pretty l <$$> resBanner w <$$> res
hunk ./src/UI/UIStarter.hs 323
-resToDoc :: Int -> Either String ([(Name,Int)],[[Dec]]) -> Doc
-resToDoc w (Left msg) = 
-    red . text $ "UNCAUGHT ERROR: " ++ msg
-resToDoc w (Right (ls,ds)) = vcat $
-    (foldl printLoop (text "    loops" ) ls) :
-    (map (printHypo (length ds)) (zip ds [1..]))
+resToDoc :: Int -> Doc -> Either String ([(Name,Int)],[[Dec]]) -> Doc
+resToDoc w t (Left msg) = 
+    outroBanner <$$>
+    (red . text $ "UNCAUGHT ERROR: " ++ msg)
+resToDoc w t (Right (ls,ds)) = 
+    outroBanner <$$>
+    (foldl printLoop (text "    loops" ) ls) <$>
+    (indent 13 $ text "CPU:" <+> t) <>
+    vcat (map (printHypo (length ds)) (zip ds [1..]))
hunk ./src/UI/UIStarter.hs 334
-                        indent 13 (fill 12 (pretty n) <+>text "in" <+> int (i-1)) <+> d
-
+                        indent 13 (fill 12 (pretty n) <+>
+                        text "in" <+> int (i-1)) <+> d