on master help sign in
Fix PrintfArg fallout from 93e3705127dc9a01c5

`PrintfArg` is extensible only from base-4.7 on, prior to that the `PrintfArg` class is not extensible.

commitd75f34cf0c728bd9d3e11ff8dd08e3a276d4139b authorHerbert Valerio Riedel <hvr@gnu.org> dateMon 21 Dec 2015, 10:13 (11 years ago) parenta0dc18e
2 files changed+10
Data/Text.hs+5 Data/Text/Lazy.hs+5
Data/Text.hs+5
@@ -240,7 +240,9 @@ import Data.Int (Int64)
240240#if __GLASGOW_HASKELL__ >= 708
241241import qualified GHC.Exts as Exts
242242#endif
243+#if MIN_VERSION_base(4,7,0)
243244import Text.Printf (PrintfArg, formatArg, formatString)
245+#endif
244246
245247-- $strict
246248--
@@ -387,8 +389,11 @@ instance Data Text where
387389 _ -> P.error "gunfold"
388390 dataTypeOf _ = textDataType
389391
392+#if MIN_VERSION_base(4,7,0)
393+-- | Only defined for @base-4.7.0.0@ and later
390394instance PrintfArg Text where
391395 formatArg txt = formatString $ unpack txt
396+#endif
392397
393398packConstr :: Constr
394399packConstr = mkConstr textDataType "pack" [] Prefix
Data/Text/Lazy.hs+5
@@ -240,7 +240,9 @@ import qualified GHC.Base as GHC
240240import qualified GHC.Exts as Exts
241241#endif
242242import GHC.Prim (Addr#)
243+#if MIN_VERSION_base(4,7,0)
243244import Text.Printf (PrintfArg, formatArg, formatString)
245+#endif
244246
245247-- $fusion
246248--
@@ -388,8 +390,11 @@ instance Data Text where
388390 _ -> error "Data.Text.Lazy.Text.gunfold"
389391 dataTypeOf _ = textDataType
390392
393+#if MIN_VERSION_base(4,7,0)
394+-- | Only defined for @base-4.7.0.0@ and later
391395instance PrintfArg Text where
392396 formatArg txt = formatString $ unpack txt
397+#endif
393398
394399packConstr :: Constr
395400packConstr = mkConstr textDataType "pack" [] Prefix