Commit 0c2b9c0d authored by Simon Marlow's avatar Simon Marlow
Browse files

Use a stable ordering of the export list

parent e3aed8ac
...@@ -12,6 +12,8 @@ import Config ...@@ -12,6 +12,8 @@ import Config
import Annrun01_Help import Annrun01_Help
import qualified Language.Haskell.TH as TH import qualified Language.Haskell.TH as TH
import Data.List
import Data.Function
main = defaultErrorHandler defaultDynFlags $ runGhc (Just cTop) $ do main = defaultErrorHandler defaultDynFlags $ runGhc (Just cTop) $ do
liftIO $ putStrLn "Initializing Package Database" liftIO $ putStrLn "Initializing Package Database"
...@@ -34,7 +36,7 @@ main = defaultErrorHandler defaultDynFlags $ runGhc (Just cTop) $ do ...@@ -34,7 +36,7 @@ main = defaultErrorHandler defaultDynFlags $ runGhc (Just cTop) $ do
liftIO $ putStrLn "Showing Details For Module" liftIO $ putStrLn "Showing Details For Module"
showTargetAnns (ModuleTarget mod) showTargetAnns (ModuleTarget mod)
liftIO $ putStrLn "Showing Details For Exports" liftIO $ putStrLn "Showing Details For Exports"
mapM (showTargetAnns . NamedTarget) $ modInfoExports mod_info mapM (showTargetAnns . NamedTarget) $ sortBy (compare `on` getOccName) $ modInfoExports mod_info
showTargetAnns :: CoreAnnTarget -> Ghc () showTargetAnns :: CoreAnnTarget -> Ghc ()
showTargetAnns target = do showTargetAnns target = do
...@@ -42,4 +44,4 @@ showTargetAnns target = do ...@@ -42,4 +44,4 @@ showTargetAnns target = do
(mb_bool_anns :: [Maybe Bool]) <- findGlobalAnns deserializeWithData target (mb_bool_anns :: [Maybe Bool]) <- findGlobalAnns deserializeWithData target
(string_anns :: [String]) <- findGlobalAnns deserializeWithData target (string_anns :: [String]) <- findGlobalAnns deserializeWithData target
(name_anns :: [TH.Name]) <- findGlobalAnns deserializeWithData target (name_anns :: [TH.Name]) <- findGlobalAnns deserializeWithData target
liftIO $ print (int_anns, mb_bool_anns, string_anns, name_anns) liftIO $ print (int_anns, mb_bool_anns, string_anns, name_anns)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment