diff options
author | Rutger Broekhoff | 2025-07-23 12:05:08 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2025-07-23 12:05:08 +0200 |
commit | 56273cf3b371312f0e72fc2af95a9dcacc8228b8 (patch) | |
tree | b4249523cab145fa32e2fdfb826cb592dcfdc127 /app/Data/Iban.hs | |
parent | a40d93a36f0dd9f493757d793321f38a58cbb21b (diff) | |
download | rdcapsis-56273cf3b371312f0e72fc2af95a9dcacc8228b8.tar.gz rdcapsis-56273cf3b371312f0e72fc2af95a9dcacc8228b8.zip |
Slaying
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 | ||