packages feed

iban 0.1.0.0 → 0.1.1.0

raw patch · 4 files changed

+21/−13 lines, 4 filesdep ~textPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: text

API changes (from Hackage documentation)

Files

Changelog.md view
@@ -1,6 +1,11 @@ # Changelog +## Version 0.1.1++ * Filter wrong characters in account number and blz in Finance.IBAN.Germany,+ * Update text dependency.+ ## Version 0.1 -Initial version with validator for IBANs. Includes rudimentary German legacy account to iban functionality.+Initial version with validator for IBANs. Includes rudimentary German legacy account to IBAN functionality. 
iban.cabal view
@@ -2,10 +2,10 @@ -- see http://haskell.org/cabal/users-guide/  name:                iban-version:             0.1.0.0+version:             0.1.1.0 synopsis:            Validate and generate IBANs description:         A library to validate and generate (for now only German) IBANs.-homepage:            https://github.com/ibotty/haskell-iban+homepage:            https://github.com/ibotty/iban license:             BSD3 license-file:        LICENSE author:              Tobias Florek@@ -27,25 +27,25 @@   other-extensions:    OverloadedStrings   build-depends:       base >=4.5 && <4.8                      , containers >=0.3 && <0.6-                     , text >=0.11 && <1.2-                     , unordered-containers ==0.2.*                      , iso3166-country-codes+                     , text >=0.11 && <1.3+                     , unordered-containers ==0.2.*   hs-source-dirs:      src   default-language:    Haskell2010  test-suite tests   other-extensions:    OverloadedStrings   build-depends:       base+                     , HUnit                      , iban-                     , text                      , tasty                      , tasty-hunit-                     , HUnit+                     , text   hs-source-dirs:      test-  main-is:             Main.hs-  other-modules:       IBANRegistryExamples-  default-language:    Haskell2010-  type:                exitcode-stdio-1.0+  main-is:           Main.hs+  other-modules:     IBANRegistryExamples+  default-language:  Haskell2010+  type:              exitcode-stdio-1.0  -- flag maintenance-tools --   description:       Build tools to generate data files from original sources
src/Finance/IBAN/Germany.hs view
@@ -10,6 +10,7 @@   ) where  import Control.Arrow (second)+import Data.Char (isDigit) import Data.Text (Text) import Finance.IBAN.Internal import Finance.IBAN.Germany.Core@@ -20,7 +21,7 @@ import qualified Data.Text as T  ibanFromLegacy :: BLZ -> AccountNr -> (IBAN, Maybe BIC)-ibanFromLegacy blz account = (IBAN (ibanWithChecksum checksum), mBIC)+ibanFromLegacy blz' account' = (IBAN (ibanWithChecksum checksum), mBIC)   where     mBIC = HM.lookup blz blzBICs     ibanWithChecksum c = T.concat [cc, c, blz, accountStr]@@ -30,6 +31,9 @@     checksum = T.pack $ case show (98 - mod97_10 ibanCandidate) of                           [d,d'] -> [ d,  d']                           [d']   -> ['0', d']+    filterNumbers = T.filter isDigit+    blz = filterNumbers blz'+    account = filterNumbers account'  legacyFromIBAN :: IBAN -> (BLZ, AccountNr) legacyFromIBAN = second (T.dropWhile (== '0')) . T.splitAt 8 . T.drop 4 . rawIBAN
test/Main.hs view
@@ -7,7 +7,6 @@ import Finance.IBAN.Germany import Test.Tasty import Test.Tasty.HUnit-import Test.HUnit  import qualified IBANRegistryExamples as R import qualified Data.Text as T