version_main _ _ = putStrLn $ "hpc tools, version 0.5-dev"
-------------------------------------------------------------------------------
\ No newline at end of file
+------------------------------------------------------------------------------
import HpcFlags
import Control.Monad
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
+import qualified HpcSet as Set
+import qualified HpcMap as Map
import System.Environment
------------------------------------------------------------------------------
import System.Console.GetOpt
import Data.Maybe ( fromMaybe )
-import qualified Data.Set as Set
+import qualified HpcSet as Set
import Data.Char
import Trace.Hpc.Tix
--- /dev/null
+module HpcMap ( module HpcMap ) where
+
+#if __GLASGOW_HASKELL__ < 604
+import qualified Data.FiniteMap as Map
+#else
+import qualified Data.Map as Map
+#endif
+
+
+lookup :: Ord key => key -> Map key elt -> Maybe elt
+fromList :: Ord key => [(key,elt)] -> Map key elt
+
+
+#if __GLASGOW_HASKELL__ < 604
+type Map key elt = Map.FiniteMap key elt
+
+lookup = flip Map.lookupFM
+fromList = Map.listToFM
+
+#else
+
+type Map key elt = Map.Map key elt
+
+lookup = Map.lookup
+fromList = Map.fromList
+
+#endif
import Data.List
import Data.Maybe(fromJust)
import Data.Array
-import qualified Data.Set as Set
+import qualified HpcSet as Set
------------------------------------------------------------------------------
markup_options =
[ excludeOpt,includeOpt,hpcDirOpt,hsDirOpt,funTotalsOpt
, altHighlightOpt
+#if __GLASGOW_HASKELL__ >= 604
, destDirOpt
+#endif
]
markup_plugin = Plugin { name = "markup"
Nothing -> error $ "unable to find tix file for: " ++ prog
Just a -> return a
+#if __GLASGOW_HASKELL__ >= 604
-- create the dest_dir if needed
createDirectoryIfMissing True dest_dir
+#endif
mods <-
sequence [ genHtmlFromMod dest_dir hpcDirs tix theFunTotals theHsPath invertOutput
import Trace.Hpc.Mix
import Trace.Hpc.Tix
import Control.Monad hiding (guard)
-import qualified Data.Set as Set
+import qualified HpcSet as Set
notExpecting :: String -> a
notExpecting s = error ("not expecting "++s)
--- /dev/null
+module HpcSet ( module HpcSet ) where
+
+import qualified Data.Set as Set
+
+type Set a = Set.Set a
+
+empty :: Set a
+insert :: (Ord a) => a -> Set a -> Set a
+member :: (Ord a) => a -> Set a -> Bool
+null :: Set a -> Bool
+intersection :: Ord a => Set a -> Set a -> Set a
+fromList :: Ord a => [a] -> Set a
+toList :: Set a -> [a]
+union :: Ord a => Set a -> Set a -> Set a
+
+#if __GLASGOW_HASKELL__ < 604
+
+empty = Set.emptySet
+insert = flip Set.addToSet
+member = Set.elementOf
+null = Set.isEmptySet
+intersection = Set.intersect
+fromList = Set.mkSet
+toList = Set.setToList
+union = Set.union
+
+#else
+
+empty = Set.empty
+insert = Set.insert
+member = Set.member
+null = Set.null
+intersection = Set.intersection
+fromList = Set.fromList
+toList = Set.toList
+union = Set.union
+
+#endif
+
HPC_LIB = $(TOP)/libraries/hpc
include $(GHC_COMPAT_DIR)/compat.mk
-SRC_HC_OPTS += $(PACKAGE_HPC)
+SRC_HC_OPTS += $(PACKAGE_HPC) -cpp
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hpc