text-format 0.3.1.1 → 0.3.2
raw patch · 7 files changed
+50/−15 lines, 7 filesdep +semigroupsdep −integerdep ~basenew-uploader
Dependencies added: semigroups
Dependencies removed: integer
Dependency ranges changed: base
Files
- CHANGELOG.md +3/−0
- Data/Text/Buildable.hs +16/−2
- Data/Text/Format.hs +1/−1
- Data/Text/Format/Functions.hs +2/−1
- Data/Text/Format/Int.hs +2/−1
- Data/Text/Format/Types/Internal.hs +5/−1
- text-format.cabal +21/−9
+ CHANGELOG.md view
@@ -0,0 +1,3 @@+# O.3.2 [Non-maintainer upload]++- Semigroup-Monoid compatibility (GHC-8.4)
Data/Text/Buildable.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleInstances, OverloadedStrings #-}+{-# LANGUAGE CPP, FlexibleInstances, OverloadedStrings #-} -- | -- Module : Data.Text.Buildable@@ -16,10 +16,15 @@ Buildable(..) ) where +#if MIN_VERSION_base(4,8,0)+import Data.Void (Void, absurd)+#endif++import Data.Semigroup ((<>)) import Data.Monoid (mempty) import Data.Int (Int8, Int16, Int32, Int64)+import Data.Fixed (Fixed, HasResolution, showFixed) import Data.Ratio (Ratio, denominator, numerator)-import Data.Text.Format.Functions ((<>)) import Data.Text.Format.Int (decimal, hexadecimal) import Data.Text.Format.Types (Hex(..), Shown(..)) import Data.Text.Lazy.Builder@@ -40,6 +45,11 @@ instance Buildable Builder where build = id +#if MIN_VERSION_base(4,8,0)+instance Buildable Void where+ build = absurd+#endif+ instance Buildable LT.Text where build = fromLazyText {-# INLINE build #-}@@ -82,6 +92,10 @@ instance Buildable Integer where build = decimal+ {-# INLINE build #-}++instance (HasResolution a) => Buildable (Fixed a) where+ build = build . showFixed False {-# INLINE build #-} instance Buildable Word8 where
Data/Text/Format.hs view
@@ -35,8 +35,8 @@ , shortest ) where +import Data.Semigroup ((<>)) import Control.Monad.IO.Class (MonadIO(liftIO))-import Data.Text.Format.Functions ((<>)) import Data.Text.Format.Params (Params(..)) import Data.Text.Format.Types.Internal (Format(..), Only(..), Shown(..)) import Data.Text.Format.Types.Internal (Hex(..))
Data/Text/Format/Functions.hs view
@@ -13,7 +13,7 @@ module Data.Text.Format.Functions (- (<>)+ (Data.Text.Format.Functions.<>) , i2d ) where @@ -30,6 +30,7 @@ -- left. (<>) :: Builder -> Builder -> Builder (<>) = mappend+{-# DEPRECATED (<>) "Use <> from Data.Semigroup" #-} {-# INLINE (<>) #-} infixr 4 <>
Data/Text/Format/Int.hs view
@@ -18,7 +18,8 @@ import Data.Int (Int8, Int16, Int32, Int64) import Data.Monoid (mempty)-import Data.Text.Format.Functions ((<>), i2d)+import Data.Semigroup ((<>))+import Data.Text.Format.Functions (i2d) import Data.Text.Lazy.Builder import Data.Word (Word, Word8, Word16, Word32, Word64) import GHC.Base (quotInt, remInt)
Data/Text/Format/Types/Internal.hs view
@@ -20,6 +20,7 @@ , Hex(..) ) where +import Data.Semigroup (Semigroup (..)) import Data.Monoid (Monoid(..)) import Data.String (IsString(..)) import Data.Text (Text)@@ -46,9 +47,12 @@ newtype Format = Format { fromFormat :: Text } deriving (Eq, Ord, Typeable, Show) +instance Semigroup Format where+ Format a <> Format b = Format (a `mappend` b)+ instance Monoid Format where- Format a `mappend` Format b = Format (a `mappend` b) mempty = Format mempty+ mappend = (<>) instance IsString Format where fromString = Format . fromString
text-format.cabal view
@@ -1,5 +1,5 @@ name: text-format-version: 0.3.1.1+version: 0.3.2 license: BSD3 license-file: LICENSE homepage: https://github.com/bos/text-format@@ -8,7 +8,6 @@ author: Bryan O'Sullivan <bos@serpentine.com> maintainer: Bryan O'Sullivan <bos@serpentine.com> stability: experimental-tested-with: GHC == 7.0.3 synopsis: Text formatting cabal-version: >= 1.8 build-type: Simple@@ -16,8 +15,21 @@ A text formatting library optimized for both ease of use and high performance. +tested-with:+ GHC == 7.0.4+ || == 7.2.2+ || == 7.4.2+ || == 7.6.3+ || == 7.8.4+ || == 7.10.3+ || == 8.0.2+ || == 8.2.2+ || == 8.4.3+ || == 8.6.1+ extra-source-files: README.markdown+ CHANGELOG.md benchmarks/Makefile benchmarks/*.c benchmarks/*.hs@@ -25,6 +37,7 @@ flag developer description: operate in developer mode default: False+ manual: True library exposed-modules:@@ -32,15 +45,16 @@ Data.Text.Buildable Data.Text.Format.Params Data.Text.Format.Types+ Data.Text.Format.Types.Internal other-modules: Data.Text.Format.Functions Data.Text.Format.Int- Data.Text.Format.Types.Internal build-depends: array,- base == 4.*,+ base >=4.3 && <4.12,+ integer-gmp >= 0.2, double-conversion >= 0.2.0.0, ghc-prim, old-locale,@@ -56,11 +70,9 @@ cpp-options: -DINTEGER_GMP - if impl(ghc >= 6.11)- build-depends: integer-gmp >= 0.2-- if impl(ghc >= 6.9) && impl(ghc < 6.11)- build-depends: integer >= 0.1 && < 0.2+ if !impl(ghc >= 8.0)+ build-depends:+ semigroups >= 0.18.5 && < 0.19 source-repository head type: git