summaryrefslogtreecommitdiffstats
path: root/app/Data/Iban.hs
diff options
context:
space:
mode:
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