formatn 0.2.1 → 0.2.2
raw patch · 2 files changed
+10/−9 lines, 2 filesdep ~textPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: text
API changes (from Hackage documentation)
Files
- formatn.cabal +7/−6
- src/Data/FormatN.hs +3/−3
formatn.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: formatn-version: 0.2.1+version: 0.2.2 synopsis: Formatting of doubles. description: This package provides support for number formatting styles, especially styles involving significant figure calculations.@@ -20,6 +20,7 @@ license: BSD-3-Clause license-file: LICENSE build-type: Simple+tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.2.5 || ==9.4.4 source-repository head type: git@@ -30,15 +31,15 @@ default-extensions: ghc-options: -Wall -Wcompat -Wincomplete-record-updates- -Wincomplete-uni-patterns -Wredundant-constraints -fwrite-ide-info- -hiedir=.hie+ -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- , base >=4.7 && <5+ , base >=4.7 && <5 , containers ^>=0.6- , text ^>=1.2- -- just for cabal-docspec --check-properties , QuickCheck+ , text >=1.2 && <2.1++ -- just for cabal-docspec --check-properties exposed-modules: Data.FormatN other-modules: default-language: Haskell2010
src/Data/FormatN.hs view
@@ -194,7 +194,7 @@ -- | expt format for a SigFig exptSF :: SigFig -> Text-exptSF (SigFig s i e) = pack $ sfsign s <> bool (i'' <> "e" <> show e') "0" (i==0)+exptSF (SigFig s i e) = pack $ sfsign s <> bool (i'' <> "e" <> show e') "0" (i == 0) where i'' | length i' == 1 = i'@@ -215,7 +215,7 @@ exptSFWith :: Maybe Int -> SigFig -> Text exptSFWith eover (SigFig s i e) = pack (sfsign s) <> posDecimalSF i (e - e') <> "e" <> pack (show e') where- e' = fromMaybe (bool (e + length (show i) - 1) 0 (i==0)) eover+ e' = fromMaybe (bool (e + length (show i) - 1) 0 (i == 0)) eover -- Formatting the positive component in decimal style posDecimalSF :: Integer -> Int -> Text@@ -404,7 +404,7 @@ expXs = major [x | (ExponentStyle x) <- s <$> xs] -major :: Ord a => [a] -> Maybe a+major :: (Ord a) => [a] -> Maybe a major xs = fst <$> listToMaybe (List.sortOn (Down . snd) $ Map.toList $ Map.fromListWith (+) ((,1 :: Integer) <$> xs)) -- | format a number according to a FormatStyle and significant figures