on master help sign in
Fix 6.12 compilation warning
760bce7Bryan O'Sullivan
Data/Text.hs+13−7
@@ -172,7 +172,12 @@ import Control.DeepSeq (NFData)
172#endif
172#endif
173import Control.Exception (assert)
173import Control.Exception (assert)
174import Data.Char (isSpace)
174import 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
176import Control.Monad (foldM)
181import Control.Monad (foldM)
177import Control.Monad.ST (ST)
182import Control.Monad.ST (ST)
178import qualified Data.Text.Array as A
183import qualified Data.Text.Array as A
@@ -233,15 +238,16 @@ instance NFData Text
233
238
234-- "could we get a Data instance for Data.Text.Text?"
239-- "could we get a Data instance for Data.Text.Text?"
235-- http://groups.google.com/group/haskell-cafe/browse_thread/thread/b5bbb1b28a7e525d/0639d46852575b93
240-- http://groups.google.com/group/haskell-cafe/browse_thread/thread/b5bbb1b28a7e525d/0639d46852575b93
236−--
241+
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
240instance Data Text where
242instance Data Text where
241 gfoldl f z txt = z pack `f` (unpack txt)
243 gfoldl f z txt = z pack `f` (unpack txt)
242− toConstr _ = error "Data.Text.Text:toConstr"
244+ toConstr _ = error "Data.Text.Text.toConstr"
243− gunfold _ _ = error "Data.Text.Text:gunfold"
245+ gunfold _ _ = error "Data.Text.Text.gunfold"
246+#if __GLASGOW_HASKELL__ >= 612
247+ dataTypeOf _ = mkNoRepType "Data.Text.Text"
248+#else
244 dataTypeOf _ = mkNorepType "Data.Text.Text"
249 dataTypeOf _ = mkNorepType "Data.Text.Text"
250+#endif
245
251
246-- -----------------------------------------------------------------------------
252-- -----------------------------------------------------------------------------
247-- * Conversion to/from 'Text'
253-- * Conversion to/from 'Text'