diff options
Diffstat (limited to 'app/Data/Iban.hs')
-rw-r--r-- | app/Data/Iban.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/Data/Iban.hs b/app/Data/Iban.hs index 412577a..d9566b9 100644 --- a/app/Data/Iban.hs +++ b/app/Data/Iban.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | module Data.Iban (Iban, mkIban) where | 1 | module Data.Iban (Iban, mkIban, toText) where |
2 | 2 | ||
3 | import Control.Applicative ((<|>)) | 3 | import Control.Applicative ((<|>)) |
4 | import Data.Attoparsec.Text as AP | 4 | import Data.Attoparsec.Text as AP |
@@ -43,3 +43,6 @@ validateIban = AP.parseOnly $ do | |||
43 | charsToInteger chars * 1000000 + charsToInteger countryCode * 100 + charsToInteger checkDigits | 43 | charsToInteger chars * 1000000 + charsToInteger countryCode * 100 + charsToInteger checkDigits |
44 | valid countryCode checkDigits chars = | 44 | valid countryCode checkDigits chars = |
45 | ibanToInteger countryCode checkDigits chars `mod` 97 == 1 | 45 | ibanToInteger countryCode checkDigits chars `mod` 97 == 1 |
46 | |||
47 | toText :: Iban -> T.Text | ||
48 | toText (Iban t) = t | ||