Last active
August 29, 2015 14:21
-
-
Save BernardNotarianni/8ef5bedadc1ee32bd616 to your computer and use it in GitHub Desktop.
carpaccio haskell comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- vat processing input from a list | |
-- maybe more adapted if data would come from an external sources? | |
vat :: String -> Double | |
vat c = | |
case c `lookup` vatRates of | |
Just x -> x | |
Nothing -> 0 | |
vatRates:: [(String, Double)] | |
vatRates = | |
[("DE",20), | |
("UK",21), | |
("FR",20), | |
("IT",25), | |
("ES",19), | |
("PL",21), | |
("RO",20), | |
("NL",20), | |
("BE",24), | |
("EL",20), | |
("CZ",19), | |
("PT",23), | |
("HU",27), | |
("SE",23), | |
("AT",22), | |
("BG",21), | |
("DK",21), | |
("FI",17), | |
("SK",18), | |
("IE",21), | |
("HR",23), | |
("LT",23), | |
("SI",24), | |
("LV",20), | |
("EE",22), | |
("CY",21), | |
("LU",25), | |
("MT",20)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment