[strictness, orgnise im/ex, mbInsert mbDelete minor changes
martin.hofmann@uni-bamberg.de**20081203145331] hunk ./src/Data/Hypotheses.hs 24
+import Data.List (foldl')
hunk ./src/Data/Hypotheses.hs 38
+import Debug.Trace
hunk ./src/Data/Hypotheses.hs 40
+import Data.Util
hunk ./src/Data/Hypotheses.hs 46
-data Hypo  = HH { open :: RuleFrags
-                , clsd :: Map Name Rules -- function name and names of dependent functions
-                , callings :: CallDep
+data Hypo  = HH { open :: !RuleFrags
+                , clsd :: !(Map Name Rules) -- function name and names of dependent functions
+                , callings :: !CallDep
hunk ./src/Data/Hypotheses.hs 57
-    show (HH o c cs) = showString "Hypo(o" .
+    show (HH o c cs) = showString "Hypo(\n\topen:" .
hunk ./src/Data/Hypotheses.hs 59
-                    showString ",c" .
+                    showString "\n\tclosed:" .
hunk ./src/Data/Hypotheses.hs 61
+                    showString "\n\tcallings:" .
+                    shows cs $
hunk ./src/Data/Hypotheses.hs 66
-    rate h       = F.fold (\r d -> (rate r) + d) 0 (open h)
+    rate h       = F.size (open h)--F.fold (\r d -> (rate r) + d) 0 (open h)
hunk ./src/Data/Hypotheses.hs 146
-fold f i rs = S.fold f i (unHHs rs)
+fold f i rs = foldl' (flip f) i (toList rs) -- S.fold f i (unHHs rs)
hunk ./src/Data/Hypotheses.hs 156
+
hunk ./src/Data/Hypotheses.hs 161
-insert :: Hypo -> Maybe Hypos -> Maybe Hypos  
-insert h Nothing   = Just $ singleton h
-insert h (Just hs) = Just $ HHs $ S.insert h (unHHs hs)
+insert :: Hypo -> Hypos -> Hypos  
+insert h hs = HHs $ S.insert  h (unHHs hs)
+
+mbInsert :: Hypo -> Maybe Hypos -> Maybe Hypos
+mbInsert h hs = 
+    case hs of
+        Just hs' -> return $ insert h hs'
+        Nothing  -> return $ singleton h
+        
+delete :: Hypo -> Hypos -> Hypos
+delete h hs = HHs $ S.delete h (unHHs hs)
hunk ./src/Data/Hypotheses.hs 173
-delete :: Hypo -> Maybe Hypos -> Maybe Hypos
-delete _ Nothing = Nothing -- should, however, never be the case
-delete h (Just hs) = 
-    let postDel = HHs $ S.delete h (unHHs hs)
-    in if null postDel 
+mbDelete :: Hypo -> Maybe Hypos -> Maybe Hypos
+mbDelete _ Nothing   = Nothing 
+mbDelete h (Just hs) = 
+    let hs' =  delete h hs
+    in if null hs' 
hunk ./src/Data/Hypotheses.hs 179
-         else Just postDel
-    
-replace :: Hypo -> Hypo -> Maybe Hypos -> Maybe Hypos
+         else Just hs'
+               
+replace :: Hypo -> Hypo -> Hypos -> Hypos