[fix warnings, remove dead code, code cleanups
John Meacham <john@repetae.net>**20050811033201] hunk ./FindFixpoint.hs 3
+import Array
+import CharIO
hunk ./FindFixpoint.hs 7
-import Data.IntSet as IntSet
+import Data.Array.IO
hunk ./FindFixpoint.hs 9
+import Data.IntSet as IntSet
hunk ./FindFixpoint.hs 12
-import Data.Array.IO
hunk ./FindFixpoint.hs 13
-import CharIO
-import Array
hunk ./FrontEnd/Class.hs 61
-import Text.PrettyPrint.HughesPJ as PPrint
hunk ./FrontEnd/Class.hs 63
+import HasSize
hunk ./FrontEnd/Class.hs 74
+import Text.PrettyPrint.HughesPJ as PPrint
hunk ./FrontEnd/Class.hs 79
-import HasSize
hunk ./FrontEnd/Desugar.hs 43
-import Name
+import Name()
hunk ./FrontEnd/Desugar.hs 337
+patVarNames e = error $ "patVarNames: " ++ show e
hunk ./FrontEnd/Desugar.hs 368
+replaceVarNamesInPat name p = error $ "replaceVarNamesInPat: " ++ show (name,p)
hunk ./FrontEnd/Diagnostic.hs 99
-                Nothing -> "no line information"
+                _ -> "no line information"
hunk ./FrontEnd/HsErrors.hs 7
-import HsSyn
-import Warning
-import VConsts
hunk ./FrontEnd/HsErrors.hs 8
+import HsSyn
hunk ./FrontEnd/HsErrors.hs 10
+import VConsts
+import Warning
hunk ./FrontEnd/HsSyn.hs 5
-import Data.Generics
hunk ./FrontEnd/HsSyn.hs 6
-import PackedString
hunk ./FrontEnd/HsSyn.hs 7
+import Data.Generics
hunk ./FrontEnd/HsSyn.hs 9
+import PackedString
hunk ./FrontEnd/HsSyn.hs 51
-    srcLoc [] = bogusASrcLoc
hunk ./FrontEnd/Infix.hs 21
-import HsSyn
-import qualified Data.Map as Map
-import Data.Monoid
-import Name
-import DDataUtil
hunk ./FrontEnd/Infix.hs 22
-import MapBinaryInstance
+import Data.Monoid
+import DDataUtil()
hunk ./FrontEnd/Infix.hs 25
+import HsSyn
+import MapBinaryInstance()
+import Name
+import qualified Data.Map as Map
hunk ./FrontEnd/TypeSyns.hs 3
-import HsSyn hiding(srcLoc)
-import Data.FiniteMap
-import List             (nub)
-import Char
-import Utils
hunk ./FrontEnd/TypeSyns.hs 4
-import GenUtil
-import Data.Monoid
-import MonadUtil
-import MonoidUtil
-import Warning
-import TypeSynonyms
-import List
-import Control.Monad.Fix
-import FrontEnd.Desugar (doToExp)
-import DDataUtil
-import qualified Seq
hunk ./FrontEnd/TypeSyns.hs 5
+import FrontEnd.Desugar (doToExp)
+import HsSyn hiding(srcLoc)
+import List
+import TypeSynonyms
hunk ./FrontEnd/TypeSyns.hs 29
-
-
-getCurrentModule :: ScopeSM Module
-getCurrentModule = gets currentModule
-
-
hunk ./FrontEnd/TypeSyns.hs 579
-
-renameAndQualify :: HsName -> Int -> Module -> HsName
-renameAndQualify name unique currentMod
-    = case rename name unique of
-           UnQual name' -> Qual currentMod name'
-           qual_name    -> qual_name
-
--- renames a haskell name with its unique number
-rename :: HsName -> Int -> HsName
-rename n unique = hsNameIdent_u (hsIdentString_u ((show unique ++ "_") ++)) n
-
--- unRename gets the original identifier name
-
-unRename :: HsName -> HsName
-unRename name
-   = case isRenamed name of
-          False -> name
-          True  -> case name of
-                      UnQual i   -> UnQual   $ unrenameIdent i
-                      Qual mod i -> Qual mod $ unrenameIdent i
-
-unrenameIdent :: HsIdentifier -> HsIdentifier
-unrenameIdent = hsIdentString_u unRenameString
-
-isRenamed :: HsName -> Bool
-isRenamed (UnQual i)    = isIdentRenamed i
-isRenamed (Qual _mod i) = isIdentRenamed i
-
--- an identifier is renamed if it starts with one or more digits
--- such an identifier would normally be illegal in Haskell
-isIdentRenamed :: HsIdentifier -> Bool
-isIdentRenamed i = not $ null $ takeWhile isDigit $ hsIdentString i
-
-
-
-
-unRenameString :: String -> String
-unRenameString s = (dropUnderscore . dropDigits) s where
-   dropUnderscore ('_':rest) = rest
-   dropUnderscore otherList = otherList
-   dropDigits = dropWhile isDigit
-
-
-
hunk ./FrontEnd/TypeSyns.hs 613
--- takes a list of HsNames representing type variables in a data decl and
--- adds them to the current subTable
-
-updateSubTableWithHsNames :: SubTable -> [HsName] -> ScopeSM (SubTable)
-updateSubTableWithHsNames subTable hsNames = do
-      subTable' <- clobberHsNames hsNames subTable
-      return (subTable')
-
hunk ./FrontEnd/TypeSyns.hs 624
--- takes a list of decls and examines only the class decls
--- to get the names of variables used in their type sigs
-
-updateSubTableWithClasses :: SubTable -> [HsDecl] -> ScopeSM (SubTable)
-updateSubTableWithClasses subTable []
-  = return subTable
-updateSubTableWithClasses subTable (hsDecl:hsDecls)
-  = do
-      let hsNames = getHsNamesFromClass hsDecl
-      subTable'  <- clobberHsNames hsNames subTable
-      subTable'' <- updateSubTableWithClasses subTable' hsDecls
-      return (subTable'')
-
hunk ./FrontEnd/TypeSyns.hs 644
-collectDefsHsModule :: HsModule -> [(Bool,HsName,SrcLoc,[HsName])]
-collectDefsHsModule m = map g $ snd $ runWriter (mapM_ f (hsModuleDecls m)) where
-    g (b,n,sl,ns) = (b,mod n, sl, map mod ns)
-    mod = qualifyName (hsModuleName m)
-    f (HsForeignDecl a _ _ n _)  = tell [(False,n,a,[])]
-    f (HsFunBind [])  = return ()
-    f (HsFunBind (HsMatch a n _ _ _:_))  = tell [(False,n,a,[])]
-    f (HsPatBind srcLoc p _ _) = tell [ (False,n,srcLoc,[]) | n <- (getHsNamesFromHsPat p) ]
-    f (HsTypeDecl sl n _ _) = tell [(True,n,sl,[])]
-    f (HsDataDecl sl _ n _ cs _) = tell $ (True,n,sl,fsts cs'):[ (False,n,sl,[]) | (n,sl) <- cs'] where
-        cs' = concatMap namesHsConDecl cs
-    f (HsNewTypeDecl sl _ n _ c _) =  tell $ (True,n,sl,fsts cs'):[ (False,n,sl,[]) | (n,sl) <- cs'] where
-        cs' = namesHsConDecl c
-    f cd@(HsClassDecl sl _ ds) = tell $ (True,z,sl,fsts cs):[ (False,n,a,[]) | (n,a) <- cs]  where
-        Just z = maybeGetDeclName cd
-        cs = fst (mconcatMap namesHsDeclTS ds)
-    f _ = return ()
hunk ./FrontEnd/TypeSyns.hs 645
-namesHsModule m = mconcatMap namesHsDecl (hsModuleDecls m)
hunk ./FrontEnd/TypeSyns.hs 646
-namesHsDecl :: HsDecl -> ([(HsName, SrcLoc)],[(HsName, SrcLoc)])
-namesHsDecl (HsForeignDecl a _ _ n _)  = ([(n,a)],[])
-namesHsDecl (HsFunBind hsMatches)  = (getHsNamesAndASrcLocsFromHsMatches hsMatches, [])
-namesHsDecl (HsPatBind srcLoc p _ _) = (map (rtup srcLoc) (getHsNamesFromHsPat p),[])
-namesHsDecl (HsTypeDecl sl n _ _) = ([],[(n,sl)])
-namesHsDecl (HsDataDecl sl _ n _ cs _) = ( (concatMap namesHsConDecl cs) ,[(n,sl)])
-namesHsDecl (HsNewTypeDecl sl _ n _ c _) = ( (namesHsConDecl c),[(n,sl)])
-namesHsDecl cd@(HsClassDecl sl _ ds) = (mconcatMap namesHsDeclTS ds) `mappend` ([],[(z,sl)]) where
-    Just z = maybeGetDeclName cd
-namesHsDecl _ = mempty
-
-namesHsDeclTS (HsTypeSig sl ns _) = ((map (rtup sl) ns),[])
-namesHsDeclTS _ = ([],[])
-
-namesHsConDecl c = (hsConDeclName c,hsConDeclSrcLoc c) : case c of
-    HsRecDecl { hsConDeclRecArg = ra } -> concatMap (map (rtup (hsConDeclSrcLoc c)) . fst) ra
-    _ -> []
-
hunk ./FrontEnd/TypeSyns.hs 682
-getNewHsNamesFromHsQualType :: SubTable -> HsQualType -> [HsName]
-getNewHsNamesFromHsQualType subTable (HsQualType _hsContext hsType)
-  = getNewHsNamesFromHsType subTable hsType
-getNewHsNamesFromHsQualType subTable (HsUnQualType hsType)
-  = getNewHsNamesFromHsType subTable hsType
-
-getNewHsNamesFromHsType :: SubTable -> HsType -> [HsName]
-getNewHsNamesFromHsType subTable (HsTyFun hsType1 hsType2)
-  = (getNewHsNamesFromHsType subTable hsType1) ++ (getNewHsNamesFromHsType subTable hsType2)
-getNewHsNamesFromHsType subTable (HsTyTuple hsTypes)
-  = concat $ map (getNewHsNamesFromHsType subTable) hsTypes
-getNewHsNamesFromHsType subTable (HsTyApp hsType1 hsType2)
-  = (getNewHsNamesFromHsType subTable hsType1) ++ (getNewHsNamesFromHsType subTable hsType2)
-getNewHsNamesFromHsType subTable (HsTyVar hsName) = [hsName]
-getNewHsNamesFromHsType _subTable (HsTyCon _hsName)
-  = [] -- don't rename the Constructors
hunk ./FrontEnd/TypeSyns.hs 703
-
-getHsNamesFromClass :: HsDecl -> [HsName]
-getHsNamesFromClass (HsClassDecl _srcLoc _hsQualType hsDecls)
-  = getHsNamesFromTypeSigs hsDecls
-getHsNamesFromClass _otherDecl
-  = []
-
--- gets the names of the functions whose types are declared in class decls
-
-getHsNamesFromTypeSigs :: [HsDecl] -> [HsName]
-getHsNamesFromTypeSigs ((HsTypeSig _srcLoc hsNames _hsQualType):hsDecls)
-  = hsNames ++ getHsNamesFromTypeSigs hsDecls
-getHsNamesFromTypeSigs (_otherDecl:hsDecls)
-  = getHsNamesFromTypeSigs hsDecls
-getHsNamesFromTypeSigs []
-  = []
hunk ./FrontEnd/TypeSyns.hs 774
-    replaceName f object
-      = let a # b = a $ (replaceName f b)
-        in case object of
-            HsAssocNone  ->
-                HsAssocNone
-            HsAssocLeft  ->
-                HsAssocLeft
-            HsAssocRight  ->
-                HsAssocRight
+    replaceName _ object = object
hunk ./FrontEnd/TypeSyns.hs 1039
-type IdentTable = FiniteMap HsName (SrcLoc, Binding)
-addToIdentTable _ _ = return ()
+--type IdentTable = FiniteMap HsName (SrcLoc, Binding)
+--addToIdentTable _ _ = return ()
hunk ./FrontEnd/TypeSyns.hs 1043
-   = TopFun             -- function binding at the top level
-   | ClassMethod        -- name of a method in a class
-   | Instance           -- an instance decl lifted to a top-level binding
-   | WhereFun           -- function binding in a where clause
+   = WhereFun           -- function binding in a where clause
hunk ./FrontEnd/TypeSyns.hs 1049
-   | Constr             -- name is a data constructor
hunk ./Grin/PointsTo.hs 653
-    valMap = Map.fromList (zip fs' [0..])
+    --valMap = Map.fromList (zip fs' [(0::Int)..])
hunk ./Main.hs 4
-import Prelude hiding(putStrLn, putStr,print)
hunk ./Main.hs 7
+import Prelude hiding(putStrLn, putStr,print)
hunk ./Seq.hs 34
-import Data.Monoid
-import Monad
+import Data.Monoid()
hunk ./Stats.hs 14
-import Control.Monad.Trans
hunk ./Stats.hs 70
-     (x,"") -> [x]
-     (x,('.':rs)) -> x:f rs
-     (x,('{':rs)) -> case span (/= '}') rs of
+        (x,"") -> [x]
+        (x,('.':rs)) -> x:f rs
+        (x,('{':rs)) -> case span (/= '}') rs of
hunk ./Stats.hs 75
+            _ -> error "this can't happen"
+        _ -> error "this can't happen"
hunk ./data/PrimitiveOperators-in.hs 139
+prim_number _ _ _ = error "prim_number: invalid arg"
hunk ./data/PrimitiveOperators-in.hs 145
+prim_const _ _ _ = error "prim_const: invalid arg"