+-- This gives a stable ordering, as opposed to the Ord instance which
+-- gives an ordering based on the Uniques of the components, which may
+-- not be stable from run to run of the compiler.
+stableModuleCmp :: Module -> Module -> Ordering
+stableModuleCmp (Module p1 n1) (Module p2 n2)
+ = (packageIdFS p1 `compare` packageIdFS p2) `thenCmp`
+ (moduleNameFS n1 `compare` moduleNameFS n2)