Only in c2hs-0.13.4/base/general: FiniteMaps.hs
Only in c2hs-0.13.4/base/general: Sets.hs
diff -r -C2 c2hs-0.13.4/base/graphs/Marks.hs c2hs-perf-branch/base/graphs/Marks.hs
*** c2hs-0.13.4/base/graphs/Marks.hs	Wed Feb  7 09:24:46 2001
--- c2hs-perf-branch/base/graphs/Marks.hs	Wed Nov 10 19:06:15 2004
***************
*** 43,47 ****
  where
  
! import Sets	  (Set, zeroSet, addToSet, elemSet)
  import Attributes (Attrs, Attributed(..))
  
--- 43,47 ----
  where
  
! import Data.Set	  (Set, emptySet, addToSet, elementOf)
  import Attributes (Attrs, Attributed(..))
  
***************
*** 56,65 ****
  --
  newMarks :: Attributed a => Marks a
! newMarks  = Marks zeroSet
  
  -- mark an entity in a specific collection of marks (EXPORTED)
  --
  mark              :: Attributed a => Marks a -> a -> Marks a
! mark (Marks ms) e  = Marks $ addToSet (attrsOf e) ms
  
  -- test whether a given entity is marked in a given collection of marks
--- 56,65 ----
  --
  newMarks :: Attributed a => Marks a
! newMarks  = Marks emptySet
  
  -- mark an entity in a specific collection of marks (EXPORTED)
  --
  mark              :: Attributed a => Marks a -> a -> Marks a
! mark (Marks ms) e  = Marks $ addToSet ms (attrsOf e)
  
  -- test whether a given entity is marked in a given collection of marks
***************
*** 67,69 ****
  --
  isMarked              :: Attributed a => Marks a -> a -> Bool
! isMarked (Marks ms) e  = (attrsOf e) `elemSet` ms
--- 67,69 ----
  --
  isMarked              :: Attributed a => Marks a -> a -> Bool
! isMarked (Marks ms) e  = (attrsOf e) `elementOf` ms
Files c2hs-0.13.4/base/libctk.a and c2hs-perf-branch/base/libctk.a differ
diff -r -C2 c2hs-0.13.4/base/syms/Attributes.hs c2hs-perf-branch/base/syms/Attributes.hs
*** c2hs-0.13.4/base/syms/Attributes.hs	Fri Dec  3 12:24:38 1999
--- c2hs-perf-branch/base/syms/Attributes.hs	Wed Nov 10 23:47:24 2004
***************
*** 95,99 ****
  import UNames	  (NameSupply, Name,
  		   rootSupply, splitSupply, names)
! import FiniteMaps (FiniteMap, listToFM, toListFM, addToFM, lookupDftFM, zeroFM)
  
  
--- 95,100 ----
  import UNames	  (NameSupply, Name,
  		   rootSupply, splitSupply, names)
! import Data.FiniteMap (FiniteMap, listToFM, fmToList, addToFM,
! 		       lookupWithDefaultFM, emptyFM)
  
  
***************
*** 222,226 ****
  --
  newAttrTable      :: Attr a => String -> AttrTable a
! newAttrTable desc  = SoftTable zeroFM desc
  
  -- get the value of an attribute from the given attribute table (EXPORTED)
--- 223,227 ----
  --
  newAttrTable      :: Attr a => String -> AttrTable a
! newAttrTable desc  = SoftTable emptyFM desc
  
  -- get the value of an attribute from the given attribute table (EXPORTED)
***************
*** 230,234 ****
  getAttr at (Attrs   _   aid)  = 
    case at of
!     (SoftTable   fm  _) -> lookupDftFM fm undef aid
      (FrozenTable arr _) -> let (lbd, ubd) = bounds arr
  			   in
--- 231,235 ----
  getAttr at (Attrs   _   aid)  = 
    case at of
!     (SoftTable   fm  _) -> lookupWithDefaultFM fm undef aid
      (FrozenTable arr _) -> let (lbd, ubd) = bounds arr
  			   in
***************
*** 242,248 ****
  setAttr at (Attrs   pos aid) av = 
    case at of
!     (SoftTable fm desc) -> assert (isUndef (lookupDftFM fm undef aid)) 
  				  alreadySetErr $  
! 			     SoftTable (addToFM aid av fm) desc
      (FrozenTable arr _) -> interr frozenErr 
    where
--- 243,249 ----
  setAttr at (Attrs   pos aid) av = 
    case at of
!     (SoftTable fm desc) -> assert (isUndef (lookupWithDefaultFM fm undef aid)) 
  				  alreadySetErr $  
! 			     SoftTable (addToFM fm aid av) desc
      (FrozenTable arr _) -> interr frozenErr 
    where
***************
*** 258,262 ****
  updAttr at (Attrs   pos aid) av = 
    case at of
!     (SoftTable   fm  desc) -> SoftTable (addToFM aid av fm) desc
      (FrozenTable arr _)    -> interr $ "Attributes.updAttr: Tried to\
  				       \ update frozen attribute in\n"
--- 259,263 ----
  updAttr at (Attrs   pos aid) av = 
    case at of
!     (SoftTable   fm  desc) -> SoftTable (addToFM fm aid av) desc
      (FrozenTable arr _)    -> interr $ "Attributes.updAttr: Tried to\
  				       \ update frozen attribute in\n"
***************
*** 297,301 ****
  freezeAttrTable			       :: Attr a => AttrTable a -> AttrTable a
  freezeAttrTable (SoftTable   fm  desc)  = 
!   let contents = toListFM fm
        keys     = map fst contents
        lbd      = minimum keys
--- 298,302 ----
  freezeAttrTable			       :: Attr a => AttrTable a -> AttrTable a
  freezeAttrTable (SoftTable   fm  desc)  = 
!   let contents = fmToList fm
        keys     = map fst contents
        lbd      = minimum keys
diff -r -C2 c2hs-0.13.4/base/syms/NameSpaces.hs c2hs-perf-branch/base/syms/NameSpaces.hs
*** c2hs-0.13.4/base/syms/NameSpaces.hs	Sun Oct 24 15:28:35 1999
--- c2hs-perf-branch/base/syms/NameSpaces.hs	Wed Nov 10 23:47:47 2004
***************
*** 43,47 ****
  
  import Common	  (Position, Pos(posOf))	      -- for importing `Idents'
! import FiniteMaps (FiniteMap, zeroFM, addToFM, lookupFM, toListFM)
  import Idents     (Ident)
  import Errors     (interr)
--- 43,47 ----
  
  import Common	  (Position, Pos(posOf))	      -- for importing `Idents'
! import Data.FiniteMap (FiniteMap, emptyFM, addToFM, lookupFM, fmToList, listToFM)
  import Idents     (Ident)
  import Errors     (interr)
***************
*** 72,76 ****
  --
  nameSpace :: NameSpace a
! nameSpace  = NameSpace zeroFM []
  
  -- add global definition (EXPORTED)
--- 72,76 ----
  --
  nameSpace :: NameSpace a
! nameSpace  = NameSpace emptyFM []
  
  -- add global definition (EXPORTED)
***************
*** 84,88 ****
  --
  defGlobal :: NameSpace a -> Ident -> a -> (NameSpace a, Maybe a)
! defGlobal (NameSpace gs lss) id def  = (NameSpace (addToFM id def gs) lss, 
  				        lookupFM gs id)
  
--- 84,88 ----
  --
  defGlobal :: NameSpace a -> Ident -> a -> (NameSpace a, Maybe a)
! defGlobal (NameSpace gs lss) id def  = (NameSpace (addToFM gs id def) lss, 
  				        lookupFM gs id)
  
***************
*** 144,146 ****
  --
  nameSpaceToList                    :: NameSpace a -> [(Ident, a)]
! nameSpaceToList (NameSpace gs lss)  = toListFM gs ++ concat lss
--- 144,146 ----
  --
  nameSpaceToList                    :: NameSpace a -> [(Ident, a)]
! nameSpaceToList (NameSpace gs lss)  = fmToList gs ++ concat lss
diff -r -C2 c2hs-0.13.4/base/syntax/Parsers.hs c2hs-perf-branch/base/syntax/Parsers.hs
*** c2hs-0.13.4/base/syntax/Parsers.hs	Sat May 15 09:33:21 2004
--- c2hs-perf-branch/base/syntax/Parsers.hs	Wed Nov 10 19:12:05 2004
***************
*** 84,88 ****
  
  import Common     (Position, Pos (posOf), nopos)
! import FiniteMaps (FiniteMap, unitFM, joinCombFM, mapFM, lookupFM, toListFM)
  import Errors     (interr, ErrorLvl(..), Error, makeError)
  
--- 84,88 ----
  
  import Common     (Position, Pos (posOf), nopos)
! import Data.FiniteMap (FiniteMap, unitFM, plusFM_C, mapFM, lookupFM, fmToList)
  import Errors     (interr, ErrorLvl(..), Error, makeError)
  
***************
*** 208,212 ****
  p                       <|> (Parser a' (Empty x q))  = mergeEpsilon a' x q p
  (Parser a (Alts alts1)) <|> (Parser a' (Alts alts2)) = 
!   Parser (a `joinActions` a') $ Alts (joinCombFM (<|>) alts1' alts2')
    where
      alts1' = mapFM (\_ p -> Left  $> p) alts1
--- 208,212 ----
  p                       <|> (Parser a' (Empty x q))  = mergeEpsilon a' x q p
  (Parser a (Alts alts1)) <|> (Parser a' (Alts alts2)) = 
!   Parser (a `joinActions` a') $ Alts (plusFM_C (<|>) alts1' alts2')
    where
      alts1' = mapFM (\_ p -> Left  $> p) alts1
***************
*** 471,481 ****
  				. map show 
  				. map fst 
! 				. toListFM 
  				$ alts
  
! instance Token t => Show (Parser a t r) where
!   showsPrec _ (Parser a c) = shows c
  
! instance Token t => Show (Cont a t r) where
!   showsPrec _ (Empty r p ) = showString "*" . shows p
!   showsPrec _ (Alts  alts) = shows alts
--- 471,481 ----
  				. map show 
  				. map fst 
! 				. fmToList
  				$ alts
  
! --instance Token t => Show (Parser a t r) where
! --  showsPrec _ (Parser a c) = shows c
  
! --instance Token t => Show (Cont a t r) where
! --  showsPrec _ (Empty r p ) = showString "*" . shows p
! --  showsPrec _ (Alts  alts) = shows alts
diff -r -C2 c2hs-0.13.4/c2hs/c/C.hs c2hs-perf-branch/c2hs/c/C.hs
*** c2hs-0.13.4/c2hs/c/C.hs	Wed Feb 12 09:41:02 2003
--- c2hs-perf-branch/c2hs/c/C.hs	Thu Nov 11 13:43:50 2004
***************
*** 36,43 ****
  	  --
  	  Pos(posOf), 
- 	  --
- 	  -- reexported from `FiniteMaps'
- 	  --
- 	  FiniteMap,
  	  --	      
  	  -- structure tree
--- 36,39 ----
***************
*** 72,76 ****
  
  import Common     (Position, Pos(posOf))
- import FiniteMaps (FiniteMap)
  import Idents	  (Ident, lexemeToIdent)
  import Attributes (Attrs, Attr(..))
--- 68,71 ----
diff -r -C2 c2hs-0.13.4/c2hs/c/CAttrs.hs c2hs-perf-branch/c2hs/c/CAttrs.hs
*** c2hs-0.13.4/c2hs/c/CAttrs.hs	Fri Oct  8 23:32:46 2004
--- c2hs-perf-branch/c2hs/c/CAttrs.hs	Wed Nov 10 19:41:59 2004
***************
*** 365,369 ****
  -- ---------------------------------
  
! -- the object name spavce
  --
  type CObjNS = NameSpace CObj
--- 365,369 ----
  -- ---------------------------------
  
! -- the object name space
  --
  type CObjNS = NameSpace CObj
diff -r -C2 c2hs-0.13.4/c2hs/c/CParser.hs c2hs-perf-branch/c2hs/c/CParser.hs
*** c2hs-0.13.4/c2hs/c/CParser.hs	Fri Oct  8 23:32:46 2004
--- c2hs-perf-branch/c2hs/c/CParser.hs	Wed Nov 10 18:53:09 2004
***************
*** 86,90 ****
  
  import Common	  (Position, Pos(..), nopos)
! import Sets	  (Set, listToSet, joinSet, elemSet)
  import Utils      (Tag(tag))
  import UNames     (Name, NameSupply, names)
--- 86,90 ----
  
  import Common	  (Position, Pos(..), nopos)
! import Data.Set	  (Set, mkSet, union, elementOf)
  import Utils      (Tag(tag))
  import UNames     (Name, NameSupply, names)
***************
*** 282,286 ****
      let name          = (head . names) nameSupply
  	at            = newAttrs pos name
! 	predefTypeIds = listToSet . map fst $ builtinTypeNames
      decls <- parseCExtDeclList [] predefTypeIds tokens
      return (CHeader decls at)
--- 282,286 ----
      let name          = (head . names) nameSupply
  	at            = newAttrs pos name
! 	predefTypeIds = mkSet . map fst $ builtinTypeNames
      decls <- parseCExtDeclList [] predefTypeIds tokens
      return (CHeader decls at)
***************
*** 305,309 ****
  	--
  	mapM raise errs
! 	let tdefNames' = tdefNames `joinSet` (listToSet $ getTDefNames decl)
  	parseCExtDeclList (decl:decls) tdefNames' toks'
  
--- 305,309 ----
  	--
  	mapM raise errs
! 	let tdefNames' = tdefNames `union` (mkSet $ getTDefNames decl)
  	parseCExtDeclList (decl:decls) tdefNames' toks'
  
***************
*** 331,335 ****
      morphTypeNames :: Set Ident -> CToken -> CToken
      morphTypeNames tides (CTokIdent pos ide)
!       | ide `elemSet` tides  = CTokTypeName pos ide
      morphTypeNames tides tok = tok
  
--- 331,335 ----
      morphTypeNames :: Set Ident -> CToken -> CToken
      morphTypeNames tides (CTokIdent pos ide)
!       | ide `elementOf` tides  = CTokTypeName pos ide
      morphTypeNames tides tok = tok
  
Files c2hs-0.13.4/c2hs/c2hs and c2hs-perf-branch/c2hs/c2hs differ
diff -r -C2 c2hs-0.13.4/c2hs/gen/GBMonad.hs c2hs-perf-branch/c2hs/gen/GBMonad.hs
*** c2hs-0.13.4/c2hs/gen/GBMonad.hs	Sun Oct 19 11:46:10 2003
--- c2hs-perf-branch/c2hs/gen/GBMonad.hs	Wed Nov 10 19:18:53 2004
***************
*** 81,86 ****
  import Errors	  (interr)
  import Idents     (Ident, identToLexeme, onlyPosIdent)
! import FiniteMaps (FiniteMap, zeroFM, addToFM, lookupFM, joinFM, toListFM,
! 		   listToFM)
  
  -- C -> Haskell
--- 81,86 ----
  import Errors	  (interr)
  import Idents     (Ident, identToLexeme, onlyPosIdent)
! import Data.FiniteMap (FiniteMap, emptyFM, addToFM, lookupFM, plusFM,
! 		       fmToList, listToFM)
  
  -- C -> Haskell
***************
*** 238,243 ****
  		    prefix = "",
  		    frags  = [],
! 		    ptrmap = zeroFM,
! 		    objmap = zeroFM
  		  }
  
--- 238,243 ----
  		    prefix = "",
  		    frags  = [],
! 		    ptrmap = emptyFM,
! 		    objmap = emptyFM
  		  }
  
***************
*** 300,304 ****
  (isStar, cName) `ptrMapsTo` hsRepr =
    transCT (\state -> (state { 
! 		        ptrmap = addToFM (isStar, cName) hsRepr (ptrmap state)
  		      }, ()))
  
--- 300,304 ----
  (isStar, cName) `ptrMapsTo` hsRepr =
    transCT (\state -> (state { 
! 		        ptrmap = addToFM (ptrmap state) (isStar, cName) hsRepr
  		      }, ()))
  
***************
*** 315,319 ****
  hsName `objIs` obj =
    transCT (\state -> (state { 
! 		        objmap = addToFM hsName obj (objmap state)
  		      }, ()))
  
--- 315,319 ----
  hsName `objIs` obj =
    transCT (\state -> (state { 
! 		        objmap = addToFM (objmap state) hsName obj
  		      }, ()))
  
***************
*** 368,373 ****
  mergeMaps str  =
    transCT (\state -> (state { 
! 		        ptrmap = joinFM readPtrMap (ptrmap state),
! 		        objmap = joinFM readObjMap (objmap state)
  		      }, ()))
    where
--- 368,373 ----
  mergeMaps str  =
    transCT (\state -> (state { 
! 		        ptrmap = plusFM readPtrMap (ptrmap state),
! 		        objmap = plusFM readObjMap (objmap state)
  		      }, ()))
    where
***************
*** 385,391 ****
  	      objFM <- readCT objmap
  	      let dumpable = ([((isStar, identToLexeme ide), repr)
! 			      | ((isStar, ide), repr) <- toListFM ptrFM],
  			      [(identToLexeme ide, obj)
! 			      | (ide, obj)            <- toListFM objFM])
  	      return $ show dumpable
  
--- 385,391 ----
  	      objFM <- readCT objmap
  	      let dumpable = ([((isStar, identToLexeme ide), repr)
! 			      | ((isStar, ide), repr) <- fmToList ptrFM],
  			      [(identToLexeme ide, obj)
! 			      | (ide, obj)            <- fmToList objFM])
  	      return $ show dumpable
  
