diff --git a/ghc/compiler/basicTypes/Const.lhs b/ghc/compiler/basicTypes/Const.lhs
index d254cbe10bb224389e50a1eedb25daf440d4a254..0b0a3d8a7036e61101ad7dcaf764126c2ca4e449 100644
--- a/ghc/compiler/basicTypes/Const.lhs
+++ b/ghc/compiler/basicTypes/Const.lhs
@@ -36,6 +36,10 @@ import CStrings		( stringToC, charToC, charToEasyHaskell )
 
 import Outputable
 import Util		( thenCmp )
+
+#if __HASKELL1__ > 4
+import Ratio (numerator, denominator)
+#endif
 \end{code}