currencies 0.1.1.1 → 0.2.0.0
raw patch · 2 files changed
+11/−10 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- currencies.cabal +2/−1
- src/Data/Currency/Pretty.hs +9/−9
currencies.cabal view
@@ -1,5 +1,5 @@ name: currencies-version: 0.1.1.1+version: 0.2.0.0 synopsis: Currencies representation, pretty printing and conversion description: ISO 4217 Currencies representation, pretty printing and conversion: .@@ -27,6 +27,7 @@ build-depends: base >= 4.7 && < 5 , text >= 1.2 && < 2 default-language: Haskell2010+ ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints test-suite currencies-test type: exitcode-stdio-1.0
src/Data/Currency/Pretty.hs view
@@ -49,8 +49,8 @@ prettyPrintWith cnf (Amount currency amount) = prefixSymbol currency cnf $ prefixCode currency cnf- $ changeDecimalSep currency cnf- $ largeAmountSeparate currency cnf+ $ changeDecimalSep cnf+ $ largeAmountSeparate cnf $ toDecimalString currency cnf amount prefixSymbol :: (Currency c) => c -> PrettyConfig -> String -> String@@ -64,17 +64,17 @@ | suffixIsoCode cnf = val <> " " <> isoCode currency | otherwise = isoCode currency <> " " <> val -changeDecimalSep :: (Currency c) => c -> PrettyConfig -> String -> String-changeDecimalSep currency cnf = replaceFst '.' (decimalSeparator cnf)+changeDecimalSep :: PrettyConfig -> String -> String+changeDecimalSep cnf = replaceFst '.' (decimalSeparator cnf) where replaceFst :: Char -> Char -> String -> String- replaceFst c c' [] = []+ replaceFst _ _ [] = [] replaceFst c c' (s:ss) | s == c = c' : ss | otherwise = s : replaceFst c c' ss -largeAmountSeparate :: (Currency c) => c -> PrettyConfig -> String -> String-largeAmountSeparate currency cnf amount+largeAmountSeparate :: PrettyConfig -> String -> String+largeAmountSeparate cnf amount | compactFourDigitAmounts cnf = if length integer <= 4 then sign mSign unsignedAmount else separatedAmount@@ -94,8 +94,8 @@ intersperseN :: Eq a => Int -> a -> [a] -> [a] intersperseN n s ss | null remainder = ss- | otherwise = (take ++ [s]) ++ intersperseN n s remainder- where (take, remainder) = splitAt n ss+ | otherwise = (chunk ++ [s]) ++ intersperseN n s remainder+ where (chunk, remainder) = splitAt n ss sign :: Maybe Char -> String -> String sign (Just s) a = s : a