scientific 0.3.4.6 → 0.3.4.7
raw patch · 4 files changed
+15/−31 lines, 4 filesdep +bytestring-builderdep ~bytestringPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: bytestring-builder
Dependency ranges changed: bytestring
API changes (from Hackage documentation)
- Data.Scientific: toBoundedInteger :: (Integral i, Bounded i) => Scientific -> Maybe i
+ Data.Scientific: toBoundedInteger :: forall i. (Integral i, Bounded i) => Scientific -> Maybe i
- Data.Scientific: toBoundedRealFloat :: (RealFloat a) => Scientific -> Either a a
+ Data.Scientific: toBoundedRealFloat :: forall a. (RealFloat a) => Scientific -> Either a a
Files
- changelog +5/−0
- scientific.cabal +10/−15
- src/Data/ByteString/Builder/Scientific.hs +0/−7
- test/test.hs +0/−9
changelog view
@@ -1,3 +1,8 @@+0.3.4.7+ * Unconditionally export Data.ByteString.Builder.Scientific.+ The bytestring-builder cabal flag has been removed.+ Depend on bytestring-builder for backwards compatibility for GHC < 7.8.+ 0.3.4.6 * Made toDecimalDigits more similar to floatToDigits
scientific.cabal view
@@ -1,5 +1,5 @@ name: scientific-version: 0.3.4.6+version: 0.3.4.7 synopsis: Numbers represented using scientific notation description: @Data.Scientific@ provides the number type 'Scientific'. Scientific numbers are@@ -49,18 +49,13 @@ type: git location: git://github.com/basvandijk/scientific.git -flag bytestring-builder- description: Provide the Data.ByteString.Builder.Scientific module- (requires bytestring >= 0.10)- default: True- manual: True- flag integer-simple description: Use the integer-simple package instead of integer-gmp default: False library- exposed-modules: Data.Scientific+ exposed-modules: Data.ByteString.Builder.Scientific+ Data.Scientific Data.Text.Lazy.Builder.Scientific other-modules: Math.NumberTheory.Logarithms GHC.Integer.Logarithms.Compat@@ -69,6 +64,7 @@ other-extensions: DeriveDataTypeable, BangPatterns ghc-options: -Wall build-depends: base >= 4.3 && < 4.10+ , bytestring >= 0.9 && < 0.11 , ghc-prim , deepseq >= 1.3 && < 1.5 , text >= 0.8 && < 1.3@@ -77,6 +73,9 @@ , containers >= 0.1 && < 0.6 , binary >= 0.4.1 && < 0.9 + if !impl(ghc >= 7.8)+ build-depends: bytestring-builder >= 0.10.4 && < 0.11+ if flag(integer-simple) build-depends: integer-simple CPP-options: -DINTEGER_SIMPLE@@ -86,10 +85,6 @@ hs-source-dirs: src default-language: Haskell2010 - if flag(bytestring-builder)- exposed-modules: Data.ByteString.Builder.Scientific- build-depends: bytestring >= 0.10 && < 0.11- test-suite test-scientific type: exitcode-stdio-1.0 hs-source-dirs: test@@ -99,6 +94,7 @@ build-depends: scientific , base >= 4.3 && < 4.10+ , bytestring >= 0.9 && < 0.11 , binary >= 0.4.1 && < 0.9 , tasty >= 0.5 && < 0.12 , tasty-ant-xml >= 1.0 && < 1.1@@ -109,9 +105,8 @@ , QuickCheck >= 2.5 && < 2.9 , text >= 0.8 && < 1.3 - if flag(bytestring-builder)- build-depends: bytestring >= 0.10 && < 0.11- cpp-options: -DBYTESTRING_BUILDER+ if !impl(ghc >= 7.8)+ build-depends: bytestring-builder >= 0.10.4 && < 0.11 benchmark bench-scientific type: exitcode-stdio-1.0
src/Data/ByteString/Builder/Scientific.hs view
@@ -12,15 +12,8 @@ import Data.Text.Lazy.Builder.RealFloat (FPFormat(..)) import qualified Data.ByteString.Char8 as BC8--#if !MIN_VERSION_bytestring(0,10,2)-import Data.ByteString.Lazy.Builder (Builder, string8, char8)-import Data.ByteString.Lazy.Builder.ASCII (intDec)-import Data.ByteString.Lazy.Builder.Extras (byteStringCopy)-#else import Data.ByteString.Builder (Builder, string8, char8, intDec) import Data.ByteString.Builder.Extra (byteStringCopy)-#endif import Utils (roundTo, i2d)
test/test.hs view
@@ -31,16 +31,9 @@ import qualified Data.Text.Lazy.Builder.Scientific as T import Numeric ( floatToDigits ) -#ifdef BYTESTRING_BUILDER import qualified Data.ByteString.Lazy.Char8 as BLC8 import qualified Data.ByteString.Builder.Scientific as B--#if !MIN_VERSION_bytestring(0,10,2)-import qualified Data.ByteString.Lazy.Builder as B-#else import qualified Data.ByteString.Builder as B-#endif-#endif main :: IO () main = testMain $ testGroup "scientific"@@ -83,12 +76,10 @@ TL.unpack (TLB.toLazyText $ T.formatScientificBuilder Scientific.Generic Nothing s) -#ifdef BYTESTRING_BUILDER , testProperty "ByteString" $ \s -> formatScientific Scientific.Generic Nothing s == BLC8.unpack (B.toLazyByteString $ B.formatScientificBuilder Scientific.Generic Nothing s)-#endif ] , testProperty "formatScientific_fromFloatDigits" $ \(d::Double) ->