@@ -172,7 +172,12 @@ import Control.DeepSeq (NFData)
172172#endif
173173import Control.Exception (assert)
174174import Data.Char (isSpace)
175−import Data.Data (Data(gfoldl, toConstr, gunfold, dataTypeOf), mkNorepType)
175+import Data.Data (Data(gfoldl, toConstr, gunfold, dataTypeOf))
176+#if __GLASGOW_HASKELL__ >= 612
177+import Data.Data (mkNoRepType)
178+#else
179+import Data.Data (mkNorepType)
180+#endif
176181import Control.Monad (foldM)
177182import Control.Monad.ST (ST)
178183import qualified Data.Text.Array as A
@@ -233,15 +238,16 @@ instance NFData Text
233238
234239-- "could we get a Data instance for Data.Text.Text?"
235240-- http://groups.google.com/group/haskell-cafe/browse_thread/thread/b5bbb1b28a7e525d/0639d46852575b93
236−--
237−-- NOTE: we used the mispelled version of mkNoRepType for
238−-- compatibility with GHC 6.10. Eventually this should be updated:
239−-- http://hackage.haskell.org/trac/ghc/ticket/2760
241+
240242instance Data Text where
241243 gfoldl f z txt = z pack `f` (unpack txt)
242− toConstr _ = error "Data.Text.Text:toConstr"
243− gunfold _ _ = error "Data.Text.Text:gunfold"
244+ toConstr _ = error "Data.Text.Text.toConstr"
245+ gunfold _ _ = error "Data.Text.Text.gunfold"
246+#if __GLASGOW_HASKELL__ >= 612
247+ dataTypeOf _ = mkNoRepType "Data.Text.Text"
248+#else
244249 dataTypeOf _ = mkNorepType "Data.Text.Text"
250+#endif
245251
246252-- -----------------------------------------------------------------------------
247253-- * Conversion to/from 'Text'