on master help sign in
Fix PrintfArg fallout from 93e3705127dc9a01c5
d75f34cHerbert Valerio Riedel
Data/Text.hs+5
@@ -240,7 +240,9 @@ import Data.Int (Int64)
240#if __GLASGOW_HASKELL__ >= 708
240#if __GLASGOW_HASKELL__ >= 708
241import qualified GHC.Exts as Exts
241import qualified GHC.Exts as Exts
242#endif
242#endif
243+#if MIN_VERSION_base(4,7,0)
243import Text.Printf (PrintfArg, formatArg, formatString)
244import Text.Printf (PrintfArg, formatArg, formatString)
245+#endif
244
246
245-- $strict
247-- $strict
246--
248--
@@ -387,8 +389,11 @@ instance Data Text where
387 _ -> P.error "gunfold"
389 _ -> P.error "gunfold"
388 dataTypeOf _ = textDataType
390 dataTypeOf _ = textDataType
389
391
392+#if MIN_VERSION_base(4,7,0)
393+-- | Only defined for @base-4.7.0.0@ and later
390instance PrintfArg Text where
394instance PrintfArg Text where
391 formatArg txt = formatString $ unpack txt
395 formatArg txt = formatString $ unpack txt
396+#endif
392
397
393packConstr :: Constr
398packConstr :: Constr
394packConstr = mkConstr textDataType "pack" [] Prefix
399packConstr = mkConstr textDataType "pack" [] Prefix
Data/Text/Lazy.hs+5
@@ -240,7 +240,9 @@ import qualified GHC.Base as GHC
240import qualified GHC.Exts as Exts
240import qualified GHC.Exts as Exts
241#endif
241#endif
242import GHC.Prim (Addr#)
242import GHC.Prim (Addr#)
243+#if MIN_VERSION_base(4,7,0)
243import Text.Printf (PrintfArg, formatArg, formatString)
244import Text.Printf (PrintfArg, formatArg, formatString)
245+#endif
244
246
245-- $fusion
247-- $fusion
246--
248--
@@ -388,8 +390,11 @@ instance Data Text where
388 _ -> error "Data.Text.Lazy.Text.gunfold"
390 _ -> error "Data.Text.Lazy.Text.gunfold"
389 dataTypeOf _ = textDataType
391 dataTypeOf _ = textDataType
390
392
393+#if MIN_VERSION_base(4,7,0)
394+-- | Only defined for @base-4.7.0.0@ and later
391instance PrintfArg Text where
395instance PrintfArg Text where
392 formatArg txt = formatString $ unpack txt
396 formatArg txt = formatString $ unpack txt
397+#endif
393
398
394packConstr :: Constr
399packConstr :: Constr
395packConstr = mkConstr textDataType "pack" [] Prefix
400packConstr = mkConstr textDataType "pack" [] Prefix