Skip to content

Instantly share code, notes, and snippets.

@BernardNotarianni
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardNotarianni/8ef5bedadc1ee32bd616 to your computer and use it in GitHub Desktop.
Save BernardNotarianni/8ef5bedadc1ee32bd616 to your computer and use it in GitHub Desktop.
carpaccio haskell comment
-- 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