summaryrefslogtreecommitdiffstats
path: root/app/Data/Iban.hs
diff options
context:
space:
mode:
authorRutger Broekhoff2025-07-23 12:05:08 +0200
committerRutger Broekhoff2025-07-23 12:05:08 +0200
commit56273cf3b371312f0e72fc2af95a9dcacc8228b8 (patch)
treeb4249523cab145fa32e2fdfb826cb592dcfdc127 /app/Data/Iban.hs
parenta40d93a36f0dd9f493757d793321f38a58cbb21b (diff)
downloadrdcapsis-56273cf3b371312f0e72fc2af95a9dcacc8228b8.tar.gz
rdcapsis-56273cf3b371312f0e72fc2af95a9dcacc8228b8.zip
Slaying
Diffstat (limited to 'app/Data/Iban.hs')
-rw-r--r--app/Data/Iban.hs5
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 @@
1module Data.Iban (Iban, mkIban) where 1module Data.Iban (Iban, mkIban, toText) where
2 2
3import Control.Applicative ((<|>)) 3import Control.Applicative ((<|>))
4import Data.Attoparsec.Text as AP 4import 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
47toText :: Iban -> T.Text
48toText (Iban t) = t