[removed error handling from LM Monad, made relevant functions partial using an arbitrary monad
martin.hofmann@uni-bamberg.de**20090623075855] hunk ./src/Data/IOData.hs 23
-import Data.Maybe (listToMaybe)
+import Data.Maybe (listToMaybe, fromJust)
hunk ./src/Data/Rules.hs 196
-matchEval args r = noLog $ 
+matchEval args r =  
hunk ./src/Logging/Logger.hs 5
-    runELT,  runLM, unLM, noLog,
+    runELT,  runLM, unLM, -- noLog,
hunk ./src/Rating/Rateable.hs 64
-numberOfPartitions h =  length $ foldl' leastPatterns [] $ S.toList $ allRules h
+numberOfPartitions = length . (foldl' leastPatterns []) . S.toList . allRules 
hunk ./src/Rating/Rateable.hs 70
-        | otherwise            = p1:(leastPatterns ps p2)
+        | otherwise       = p1:(leastPatterns ps p2)
hunk ./src/Syntax/Antiunifier.hs 40
-type AU t = StateT (VarMap t) LM t
+type AU m t = StateT (VarMap t) m t
hunk ./src/Syntax/Antiunifier.hs 43
-evalAU :: StateT s LM a -> s -> LM a
+evalAU :: (Monad m) => StateT s m a -> s -> m a
hunk ./src/Syntax/Antiunifier.hs 48
-runAU :: StateT s LM a -> s -> LM (a, s)
+runAU :: (Monad m) => StateT s m a -> s -> m (a, s)
hunk ./src/Syntax/Antiunifier.hs 82
-    antiunify        :: [t] -> LM t
+    antiunify        :: (Monad m) => [t] -> m t
hunk ./src/Syntax/Antiunifier.hs 87
-    aunify           :: (Antiunifiable t) => [t] -> AU t
+    aunify           :: (Antiunifiable t, Monad m) => [t] -> AU m t
hunk ./src/Syntax/Antiunifier.hs 267
-checkforAntiInstance :: (Ord t, Antiunifiable t) => [t] -> AU t
+checkforAntiInstance :: (Ord t, Antiunifiable t, Monad m) => [t] -> AU m t
hunk ./src/Syntax/Antiunifier.hs 289
-computeAntiInstance :: (Ord t, Antiunifiable t) => [t] -> AU t
+computeAntiInstance :: (Ord t, Antiunifiable t, Monad m) => [t] -> AU m t
hunk ./src/Syntax/Expressions.hs 420
-        in logWA msg >> fail (show msg)       
+        in -- logWA msg >> 
+           fail (show msg)       
hunk ./src/Syntax/Expressions.hs 542
-liftUnify :: (Unifiable t) => Maybe t -> Maybe t -> U t
+liftUnify :: (Unifiable t, Monad m) => Maybe t -> Maybe t -> U m t
hunk ./src/Syntax/Expressions.hs 546
-liftMatch :: (Unifiable t) => Maybe t -> Maybe t -> U t
+liftMatch :: (Unifiable t, Monad m) => Maybe t -> Maybe t -> U m t
hunk ./src/Syntax/Expressions.hs 1235
-               
+lhs0 = [TVarE (mkName "b") (VarT (mkName "a")),TListE [](AppT ListT (VarT (mkName "a"))) ]                   
+lhs1 = [TListE [](AppT ListT (VarT (mkName "a"))),TListE [](AppT ListT (VarT (mkName "a"))) ]               
hunk ./src/Syntax/Patterns.hs 145
-        in  setCurrentLogger "Terms.Terms.apply at TPat" >>
-            logWA msg >> fail ( show msg)      
+        in  --setCurrentLogger "Terms.Terms.apply at TPat" >>
+            --logWA msg >> 
+            fail ( show msg)      
hunk ./src/Syntax/Patterns.hs 482
-        in  setCurrentLogger "Terms.Unifier.applyMgu" >>
-            logWA msg >> fail ( show msg)  
+        in  --setCurrentLogger "Terms.Unifier.applyMgu" >>
+            --logWA msg >> 
+            fail ( show msg)  
hunk ./src/Syntax/Unifier.hs 32
-type U a = StateT (Substitution a) LM ()
+type U m a = StateT (Substitution a) m ()
hunk ./src/Syntax/Unifier.hs 62
-    apply :: (Substitution a) -> a -> LM a
+    apply :: (Monad m) => (Substitution a) -> a -> m a
hunk ./src/Syntax/Unifier.hs 64
-    applyL :: (Substitutable a) => (Substitution a) -> [a] -> LM [a]
+    applyL :: (Substitutable a, Monad m) => (Substitution a) -> [a] -> m [a]
hunk ./src/Syntax/Unifier.hs 71
-    unify ::  t -> t -> U t
+    unify ::  (Monad m) => t -> t -> U m t
hunk ./src/Syntax/Unifier.hs 73
-    mgu ::  t -> t -> LM (Substitution t)
+    mgu ::  (Monad m) => t -> t -> m (Substitution t)
hunk ./src/Syntax/Unifier.hs 86
-    match ::  t -> t -> U t
+    match :: (Monad m) =>  t -> t -> U m t
hunk ./src/Syntax/Unifier.hs 91
-    matchesWithSubs :: t -> t -> LM (Substitution t)  
+    matchesWithSubs :: (Monad m) =>  t -> t -> m (Substitution t)  
hunk ./src/Syntax/Unifier.hs 98
-    equal t1 t2 = unLM $ do{matchesWithSubs t1 t2 >>= return . null} 
-                             `catchError` (const.return $ False)
+    equal = ((maybe False null) . ) . matchesWithSubs
hunk ./src/Syntax/Unifier.hs 105
-matchVar :: (Unifiable t) => t -> t -> U t
+matchVar :: (Unifiable t, Monad m) => t -> t -> U m t
hunk ./src/Syntax/Unifier.hs 119
-unifyVar :: (Unifiable t) => t -> t -> U t
+unifyVar :: (Unifiable t, Monad m) => t -> t -> U m t
hunk ./src/Syntax/Unifier.hs 130
-            llogDE ( text "Found (Var <~ Val) in current unifier:" <$>
-                     indent 2 (pretty var) <+> text " <~ " <+> pretty val <$>
-                     indent 2 (text "continue unify val x")
-                    ) >>
+--            llogDE ( text "Found (Var <~ Val) in current unifier:" <$>
+--                     indent 2 (pretty var) <+> text " <~ " <+> pretty val <$>
+--                     indent 2 (text "continue unify val x")
+--                    ) >>
hunk ./src/Syntax/Unifier.hs 137
-                            llogDE ( text "Found (X <~ Val) in current unifier:" <^>
-                                     (pretty x) <+> text "<~" <+> pretty val <^>
-                                     text "continue unify var val"
-                                    ) >>
+--                            llogDE ( text "Found (X <~ Val) in current unifier:" <^>
+--                                     (pretty x) <+> text "<~" <+> pretty val <^>
+--                                     text "continue unify var val"
+--                                    ) >>
hunk ./src/Syntax/Unifier.hs 144
-                                        else do llogDE ( text "Apply (Var <~ X) to current Unifier and Insert:" <^>
-                                                         pretty var <+> text "<~" <+> pretty x
-                                                       ) 
+                                        else do 
+--                                               llogDE ( text "Apply (Var <~ X) to current Unifier and Insert:" <^>
+--                                                         pretty var <+> text "<~" <+> pretty x
+--                                                       ) 
hunk ./src/Syntax/Unifier.hs 153
-matches t1 t2 = unLM $ do{matchesWithSubs t1 t2 >> return True} 
-                         `catchError` (const.return $ False)
+matches = (isJust .) . matchesWithSubs
hunk ./src/Syntax/Unifier.hs 163
-equalLs l1 l2 = (matchesLs l1 l2) && (matchesLs l2 l1)
+equalLs = ap (ap . ((&&) .) . subsumesLs) matchesLs
hunk ./src/Syntax/Unifier.hs 169
-matchesLs xs ys = 
-    case (zipPairsWithM matches xs ys) of
-        Just r    -> and r
-        Nothing   -> False
+matchesLs = (isJust .) .  matchesWithSubsLs
hunk ./src/Syntax/Unifier.hs 175
-matchLs :: (Unifiable t) => [t] -> [t] -> U t
-matchLs l1 l2 = 
-    case zipPairsWithM (,) l1 l2 of
-        Just ps   -> mapM_ (uncurry match) ps
-        Nothing   -> flush "matchLs: No Match!"
+matchLs :: (Unifiable t, Monad m) => [t] -> [t] -> U m t
+matchLs  = ((maybe cancel proceed) . ) . (zipPairsWithM (,))
+    where
+    cancel = flush "unifyLs: No Match!" 
+    proceed = mapM_ (uncurry match)
hunk ./src/Syntax/Unifier.hs 181
-unifyLs :: (Unifiable t) => [t] -> [t] -> U t
-unifyLs l1 l2 = 
-    case zipPairsWithM (,) l1 l2 of
-        Just ps -> mapM_ (uncurry unify) ps
-        Nothing -> flush "unifyLs: Not unifiable" 
+unifyLs :: (Unifiable t, Monad m) => [t] -> [t] -> U m t
+unifyLs = ((maybe cancel proceed) . ) . (zipPairsWithM (,))
+    where
+    cancel = flush "unifyLs: Not unifiable" 
+    proceed = mapM_ (uncurry unify)
hunk ./src/Syntax/Unifier.hs 187
-matchesWithSubsLs :: (Unifiable t ) => [t] -> [t]  -> LM (Substitution t)
+matchesWithSubsLs :: (Unifiable t, Monad m ) => [t] -> [t]  -> m (Substitution t)
hunk ./src/Syntax/Unifier.hs 193
-    mws (x:xs) (y:ys) s = 
-        do s' <- execStateT (match x y) s
-           mws xs ys s'
-
+    mws (x:xs) (y:ys) s = execStateT (match x y) s >>= mws xs ys