text-format 0.3.1.1 → 0.3.2.1
raw patch · 8 files changed
Files
- CHANGELOG.md +9/−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 +3/−2
- Data/Text/Format/Types/Internal.hs +5/−1
- README.markdown +11/−22
- text-format.cabal +39/−25
+ CHANGELOG.md view
@@ -0,0 +1,9 @@+# O.3.2.1 [Non-maintainer upload]++_2022-11-21_, Andreas Abel, on behalf of the Hackage Trustees++- Build with GHC 9.2++# 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)@@ -29,7 +30,7 @@ # if __GLASGOW_HASKELL__ < 611 import GHC.Integer.Internals # else-import GHC.Integer.GMP.Internals+import GHC.Integer.GMP.Internals (Integer(..)) # endif #endif
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
README.markdown view
@@ -1,28 +1,17 @@-# Welcome to text-format--text-format is a fast and easy-to-use Haskell library for formatting-text strings.--# Join in!--We are happy to receive bug reports, fixes, documentation enhancements,-and other improvements.--Please report bugs via the-[github issue tracker](https://github.com/bos/text-format/issues).--Master [git repository](https://github.com/bos/text-format):--* `git clone git://github.com/bos/text-format.git`--There's also a [Mercurial mirror](https://bitbucket.org/bos/text-format):+Welcome to text-format+====================== -* `hg clone https://bitbucket.org/bos/text-format`+`text-format` is a fast and easy-to-use Haskell library for formatting text strings. -(You can create and contribute changes using either git or Mercurial.)+You may report bugs via the+[github issue tracker](https://github.com/haskell-trustees/text-format/issues). Authors ------- -This library is written and maintained by Bryan O'Sullivan,-<bos@serpentine.com>.+This library has been written by Bryan O'Sullivan, <bos@serpentine.com>.++Related packages+================++- https://hackage.haskell.org/package/formatting
text-format.cabal view
@@ -1,23 +1,39 @@+cabal-version: >= 1.10 name: text-format-version: 0.3.1.1+version: 0.3.2.1 license: BSD3 license-file: LICENSE-homepage: https://github.com/bos/text-format-bug-reports: https://github.com/bos/text-format/issues+homepage: https://github.com/hackage-trustees/text-format+bug-reports: https://github.com/hackage-trustees/text-format/issues category: Text author: Bryan O'Sullivan <bos@serpentine.com>-maintainer: Bryan O'Sullivan <bos@serpentine.com>+maintainer: Hackage Trustees stability: experimental-tested-with: GHC == 7.0.3 synopsis: Text formatting-cabal-version: >= 1.8 build-type: Simple description: 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.4+ || == 8.6.5+ || == 8.8.4+ || == 8.10.7+ || == 9.0.2+ || == 9.2.5+ extra-source-files: README.markdown+ CHANGELOG.md benchmarks/Makefile benchmarks/*.c benchmarks/*.hs@@ -25,6 +41,7 @@ flag developer description: operate in developer mode default: False+ manual: True library exposed-modules:@@ -32,22 +49,25 @@ 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.*,- double-conversion >= 0.2.0.0,- ghc-prim,- old-locale,- text >= 0.11.0.8,- time,- transformers+ array+ , base >= 4.3 && < 4.17+ , integer-gmp >= 0.2+ , double-conversion >= 0.2.0.0+ , ghc-prim+ , old-locale+ , text >= 0.11.0.8+ , time+ , transformers + default-language: Haskell98+ if flag(developer) ghc-options: -Werror ghc-prof-options: -auto-all@@ -56,16 +76,10 @@ 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.20 source-repository head type: git- location: https://github.com/bos/text-format--source-repository head- type: mercurial- location: https://bitbucket.org/bos/text-format+ location: https://github.com/hackage-trustees/text-format.git