+import Prelude -- necessary to get dependencies right
+
+-- These #ifdefs are necessary because this code might be compiled as
+-- part of ghc/lib/compat, and hence might be compiled by an older version
+-- of GHC. In which case, we might need to pick up ReadP from
+-- Distribution.Compat.ReadP, because the version in
+-- Text.ParserCombinators.ReadP doesn't have all the combinators we need.
+#if __GLASGOW_HASKELL__ >= 603 || __HUGS__ || __NHC__