packages feed

formatting 7.0.0.1 → 7.0.0.2

raw patch · 12 files changed

+27/−63 lines, 12 filesdep −arraydep −bytestringdep −semigroupsdep ~timePVP ok

version bump matches the API change (PVP)

Dependencies removed: array, bytestring, semigroups

Dependency ranges changed: time

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+7.0.0.2++* Removed unnecessary dependencies on array and bytestring+* Actually removed code to support GHC < 8.4+ 7.0.0.1  * Added README.md to extra-source-files so it shows up on Hackage@@ -11,6 +16,7 @@ * Make compatible with bytestring-0.11.0.0 * Removed -O2 ghc flag * Updated .cabal file version from 1.8 to 2.4+* Drop support for GHC < 8.4  6.3.7 
README.md view
@@ -103,7 +103,7 @@ | ----------------------------------------:| ------------------------  | ----------------------------------- | -------------------------------------| | `Foldable t => t a`                      | `[1, 2, 3]`               | `"1st2nd3rd"`                       | `concatenated ords`                  | | `Foldable t => t a`                      | `[123, 456, 789]`         | `"789456123"`                       | `joinedWith (mconcat . reverse) int` |-| `Foldable t => t a`                      | `[1, 2, 3]`               | `"1||2||3"`                         | `intercalated "||" int`              |+| `Foldable t => t a`                      | `[1, 2, 3]`               | `"1\|\|2\|\|3"`                     | `intercalated "\|\|" int`            | | `Foldable t => t a`                      | `[1, 2, 3]`               | `"1 2 3"`                           | `unworded int`                       | | `Foldable t => t a`                      | `[1, 2, 3]`               | `"1\n2\n3"`                         | `unlined d`                          | | `Foldable t => t a`                      | `[1, 2, 3]`               | `"1 2 3"`                           | `spaced int`                         |
formatting.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                formatting-version:             7.0.0.1+version:             7.0.0.2 synopsis:            Combinator-based type-safe formatting (like printf() or FORMAT) description:         Combinator-based type-safe formatting (like printf() or FORMAT), modelled from the HoleyMonoids package.                      .@@ -16,26 +16,25 @@ build-type:          Simple extra-source-files:  CHANGELOG.md                      README.md+tested-with:           GHC == 8.4.4+                     , GHC == 8.6.5+                     , GHC == 8.8.3+                     , GHC == 8.10.1  common deps   build-depends:-    base >= 4.5 && < 5,+    base >= 4.11 && < 5,     text >= 0.11.0.8,-    time,+    time >= 1.5,     old-locale,     scientific >= 0.3.0.0,     clock >= 0.4,-    array,     ghc-prim,     text >= 0.11.0.8,     transformers,-    bytestring >=0.10.4,     integer-gmp >= 0.2,     double-conversion ^>= 2.0.2.0 -  if !impl(ghc >= 8.0)-    build-depends: semigroups- -- Warnings list list taken from -- https://medium.com/mercury-bank/enable-all-the-warnings-a0517bc081c3 -- Enable all warnings with -Weverything, then disable the ones we@@ -53,6 +52,9 @@                        -Wno-safe                        -Wno-unsafe                        -fprint-potential-instances+  if impl(ghc >= 8.10)+    ghc-options:       -Wno-prepositive-qualified-module+                       -Wno-missing-safe-haskell-mode   cpp-options: -DINTEGER_GMP  library
src/Data/Text/Format/Functions.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE MagicHash #-}-{-# LANGUAGE CPP #-}  -- | -- Module      : Data.Text.Format.Functions@@ -13,18 +12,13 @@ -- Useful functions and combinators.  module Data.Text.Format.Functions-    (-      (<>)+    ( (<>)     , i2d     ) where  import Data.Text.Lazy.Builder (Builder)-#if MIN_VERSION_base(4,11,0) import Prelude hiding ((<>)) import GHC.Base hiding ((<>))-#else-import GHC.Base-#endif  -- | Unsafe conversion for decimal digits. {-# INLINE i2d #-}
src/Data/Text/Format/Int.hs view
@@ -23,15 +23,8 @@ import Data.Text.Lazy.Builder import Data.Word (Word8, Word16, Word32, Word64) import GHC.Base (quotInt, remInt)-import GHC.Types (Int(..))--#ifdef  __GLASGOW_HASKELL__-# if __GLASGOW_HASKELL__ < 611-import GHC.Integer.Internals-# else import GHC.Integer.GMP.Internals-# endif-#endif+import GHC.Types (Int(..))  #ifdef INTEGER_GMP # define PAIR(a,b) (# a,b #)
src/Data/Text/Format/Types.hs view
@@ -12,9 +12,7 @@ -- Types for text mangling.  module Data.Text.Format.Types-    (--     Shown(..)+    ( Shown(..)     -- * Integer format control     , Hex(..)     ) where
src/Formatting/Buildable.hs view
@@ -16,10 +16,6 @@       Buildable(..)     ) where -#if MIN_VERSION_base(4,8,0)-import           Data.Void (Void, absurd)-#endif- import           Data.Int (Int8, Int16, Int32, Int64) import           Data.Fixed (Fixed, HasResolution, showFixed) import           Data.List (intersperse)@@ -31,6 +27,7 @@ import           Data.Time.Calendar (Day, showGregorian) import           Data.Time.Clock (getModJulianDate, DiffTime, NominalDiffTime, UTCTime, UniversalTime) import           Data.Time.LocalTime (LocalTime, TimeOfDay, TimeZone, ZonedTime)+import           Data.Void (Void, absurd) import           Data.Word (Word8, Word16, Word32, Word64) import           Foreign.Ptr (IntPtr, WordPtr, Ptr, ptrToWordPtr) import qualified Data.Text as ST@@ -43,10 +40,8 @@ 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@@ -186,9 +181,6 @@     build True = fromText "True"     build False = fromText "False" -#if MIN_VERSION_base(4,8,0) instance {-# OVERLAPPABLE #-} Buildable a => Buildable [a] where-    build = \xs -> "[" F.<> mconcat (intersperse "," (map build xs)) F.<> "]"+    build xs = "[" F.<> mconcat (intersperse "," (map build xs)) F.<> "]"     {-# INLINE build #-}-#endif-
src/Formatting/Combinators.hs view
@@ -89,10 +89,10 @@   , hexPrefix   ) where +import Control.Applicative (Const(..), getConst) import Control.Category ((>>>)) import Data.Foldable (toList) import Data.Function ((&))-import Data.Functor.Const (Const(..), getConst) import Data.Int (Int64) import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as TL
src/Formatting/Formatters.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE CPP #-}- -- | -- Module      : Formatting.Formatters -- Copyright   : (c) 2013 Chris Done, 2013 Shachaf Ben-Kiki@@ -57,9 +55,6 @@ import           Formatting.Internal  import           Data.Char (chr, ord)-#if !(MIN_VERSION_base(4,11,0))-import           Data.Monoid ((<>))-#endif import           Data.Scientific import qualified Data.Text as S import qualified Data.Text as T
src/Formatting/Internal.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE CPP #-}  -- | Internal format starters. @@ -25,7 +24,6 @@  import           Control.Category (Category(..)) import           Data.Monoid-import qualified Data.Semigroup import           Data.String import qualified Data.Text as S (Text) import           Data.Text.Lazy (Text)@@ -77,7 +75,7 @@ instance Functor (Format r) where   fmap f (Format k) = Format (f . k) -instance Data.Semigroup.Semigroup (Format r (a -> r)) where+instance Semigroup (Format r (a -> r)) where   m <> n =     Format (\k a ->               runFormat m (\b1 -> runFormat n (\b2 -> k (b1 <> b2)) a) a)@@ -85,15 +83,8 @@ -- | Useful instance for applying two formatters to the same input -- argument. For example: @format (year <> "/" % month) now@ will -- yield @"2015/01"@.-instance-#if !(MIN_VERSION_base(4,11,0))-  Semigroup (Format r (a -> r)) =>-#endif-  Monoid (Format r (a -> r)) where-#if !(MIN_VERSION_base(4,11,0))-    mappend = (<>)-#endif-    mempty = Format (\k _ -> k mempty)+instance Monoid (Format r (a -> r)) where+  mempty = Format (\k _ -> k mempty)  -- | Useful instance for writing format string. With this you can -- write @"Foo"@ instead of @now "Foo!"@.
src/Formatting/ShortFormatters.hs view
@@ -1,6 +1,4 @@ {-# LANGUAGE RankNTypes #-}-{-# OPTIONS -Wall #-}- -- | -- Module      : Formatting.ShortFormatters -- Copyright   : (c) 2013 Chris Done, 2013 Shachaf Ben-Kiki
src/Formatting/Time.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} @@ -58,7 +57,7 @@   , customTimeFmt   ) where -import           Data.List+import           Data.List (find) import           Data.Tuple import           Formatting.Formatters  hiding (build, base) import           Formatting.Internal@@ -67,11 +66,7 @@ import qualified Data.Text              as T import           Formatting.Buildable import           Data.Time (FormatTime, formatTime, defaultTimeLocale)-#if MIN_VERSION_time(1,5,0) import           System.Locale ()-#else-import           System.Locale-#endif import           Control.Monad.Trans.State.Strict  -- * For 'TimeZone' (and 'ZonedTime' and 'UTCTime'):