data-standards (empty) → 0.1.0.0
raw patch · 11 files changed
+2847/−0 lines, 11 filesdep +basedep +hashabledep +unordered-containerssetup-changed
Dependencies added: base, hashable, unordered-containers
Files
- ChangeLog.md +7/−0
- Data/Standards/ISO/Country/Primary.hs +24/−0
- Data/Standards/ISO/Country/Primary/Alpha2.hs +473/−0
- Data/Standards/ISO/Country/Primary/Alpha3.hs +519/−0
- Data/Standards/ISO/Country/Primary/Common.hs +32/−0
- Data/Standards/ISO/Country/Primary/Numeric.hs +921/−0
- Data/Standards/ISO/Country/Primary/Translation.hs +413/−0
- LICENSE +373/−0
- README.md +37/−0
- Setup.hs +2/−0
- data-standards.cabal +46/−0
+ ChangeLog.md view
@@ -0,0 +1,7 @@+# Revision history for data-standards++## 0.1.0.0 -- 2018-07-06++* ISO 3166-1, in all three variants (alpha-2, alpha-3, and numeric)+ * Methods of converting between all three+ * Historic or otherwise discouraged codes marked as such
+ Data/Standards/ISO/Country/Primary.hs view
@@ -0,0 +1,24 @@+{-# OPTIONS_HADDOCK not-home #-}++{- | Module : Data.Standards.ISO.Country.Primary+ - Description : The country codes described by ISO 3166-1.+ - Copyright : (c) 2018 Samuel May+ - License : MPL-2.0+ - Maintainer : ag.eitilt@gmail.com+ - Stability : provisional+ - Portability : portable+ -}+module Data.Standards.ISO.Country.Primary+ ( module Data.Standards.ISO.Country.Primary.Translation+ , A2.Alpha2 ( .. )+ , A3.Alpha3 ( .. )+ , N.Numeric ( .. )+ , C.Status ( .. )+ ) where++import qualified Data.Standards.ISO.Country.Primary.Alpha2 as A2+import qualified Data.Standards.ISO.Country.Primary.Alpha3 as A3+import qualified Data.Standards.ISO.Country.Primary.Common as C+import qualified Data.Standards.ISO.Country.Primary.Numeric as N++import Data.Standards.ISO.Country.Primary.Translation
+ Data/Standards/ISO/Country/Primary/Alpha2.hs view
@@ -0,0 +1,473 @@+{- | Module : Data.Standards.ISO.Country.Primary.Alpha2+ - Description : The two-character country codes described by ISO 3166-1.+ - Copyright : (c) 2018 Samuel May+ - License : MPL-2.0+ - Maintainer : ag.eitilt@gmail.com+ - Stability : provisional+ - Portability : portable+ -}+module Data.Standards.ISO.Country.Primary.Alpha2+ ( Alpha2 ( .. )+ , Status ( .. )+ , codeStatus+ ) where++import Data.Standards.ISO.Country.Primary.Common++import qualified Data.Hashable as H++{-# WARNING UK "Official country code is GB" #-}++{-# DEPRECATED AN "Divided into BQ, CW and SX, or use ISO 3166-3 code ANHH" #-}+{-# DEPRECATED BU "Use new code MM or ISO 3166-3 code BUMM" #-}+{-# DEPRECATED CS "Divided into ME and RS, or use ISO 3166-3 code CSXX; previous usage divided into CZ and SK, or use ISO 3166-3 code CSHH" #-}+{-# DEPRECATED NT "Divided between IQ and SA, or use ISO 3166-3 code NTHH" #-}+{-# DEPRECATED TP "Use new code TL or ISO 3166-3 code TPTL" #-}+{-# DEPRECATED YU "Use ISO 3166-3 code YUCS" #-}+{-# DEPRECATED ZR "Use new code CD or ISO 3166-3 code ZRCD" #-}++{-# DEPRECATED DY "Use official code BJ" #-}+{-# DEPRECATED EW "Use official code EE" #-}+{-# DEPRECATED FL "Use official code LI" #-}+{-# DEPRECATED JA "Use official code JM" #-}+{-# DEPRECATED LF "Use code for entire country LY" #-}+{-# DEPRECATED PI "Use official code PH" #-}+{-# DEPRECATED RA "Use official code AR" #-}+{-# DEPRECATED RB "Use official code BO or BW, respectively" #-}+{-# DEPRECATED RC "Use official code CN" #-}+{-# DEPRECATED RH "Use official code HT" #-}+{-# DEPRECATED RI "Use official code ID" #-}+{-# DEPRECATED RM "Use official code MG" #-}+{-# DEPRECATED RN "Use official code NE" #-}+{-# DEPRECATED RP "Use official code PH" #-}+{-# DEPRECATED SF "Use official code FI" #-}+{-# DEPRECATED WG "Use official code GD" #-}+{-# DEPRECATED WL "Use official code LC" #-}+{-# DEPRECATED WV "Use official code VC" #-}+{-# DEPRECATED YV "Use official code VE" #-}++{-# WARNING AP,BX,EF,EM,EP,EV,GC,IB,OA,WO "Not an official ISO 3166-1 code" #-}++{-# DEPRECATED CT "Use new code KI or ISO 3166-3 code CTKI" #-}+{-# DEPRECATED DD "Use new code DE or ISO 3166-3 code DDDE" #-}+{-# DEPRECATED FQ "Divided into TF and part of AQ, or use ISO 3166-3 code FQHH" #-}+{-# DEPRECATED HV "Use new code BF or ISO 3166-3 code HVBF" #-}+{-# DEPRECATED JT "Use new code UM or ISO 3166-3 code JTUM" #-}+{-# DEPRECATED MI "Use new code UM or ISO 3166-3 code MIUM" #-}+{-# DEPRECATED NH "Use new code VU or ISO 3166-3 code NHVU" #-}+{-# DEPRECATED NQ "Use new code AQ or ISO 3166-3 code NQAQ" #-}+{-# DEPRECATED PC "Divided into FM, MH, MP and PW, or use ISO 3166-3 code PCHH" #-}+{-# DEPRECATED PU "Use new code UM or ISO 3166-3 code PUUM" #-}+{-# DEPRECATED PZ "Use new code PA or ISO 3166-3 code PZPA" #-}+{-# DEPRECATED VD "Use new code VN or ISO 3166-3 code VDVN" #-}+{-# DEPRECATED WK "Use new code UM or ISO 3166-3 code WKUM" #-}+{-# DEPRECATED YD "Use new code YE or ISO 3166-3 code YDYE" #-}++-- | The official, recommended codes for countries, translated into a type-safe+-- representation. Unless otherwise specified, all codes are 'Official'.+data Alpha2+ = AC -- ^ 'ExceptionalReservation': Ascension Island+ | AD -- ^ Andorra+ | AE -- ^ United Arab Emirates (the)+ | AF -- ^ Afghanistan+ | AG -- ^ Antigua and Barbuda+ | AI -- ^ Anguilla; previously French Afar and Issas+ | AL -- ^ Albania+ | AM -- ^ Armenia+ | AN -- ^ 'TransitionalReservation': Netherlands Antilles+ | AO -- ^ Angola+ | AP -- ^ 'NotInUse': African Regional Industrial Property Organization+ | AQ -- ^ Antarctica+ | AR -- ^ Argentina+ | AS -- ^ American Samoa+ | AT -- ^ Austria+ | AU -- ^ Australia+ | AW -- ^ Aruba+ | AX -- ^ Åland Islands+ | AZ -- ^ Azerbaijan++ | BA -- ^ Bosnia and Herzegovina+ | BB -- ^ Barbados+ | BD -- ^ Bangladesh+ | BE -- ^ Belgium+ | BF -- ^ Burkina Faso+ | BG -- ^ Bulgaria+ | BH -- ^ Bahrain+ | BI -- ^ Burundi+ | BJ -- ^ Benin+ | BL -- ^ Saint Barthélemy+ | BM -- ^ Bermuda+ | BN -- ^ Brunei Darussalam+ | BO -- ^ Bolivia (Plurinational State of)+ | BQ -- ^ Bonaire, Sint Eustatius and Saba; previously British Antarctic Territory (the)+ | BR -- ^ Brazil+ | BS -- ^ Bahamas (the)+ | BT -- ^ Bhutan+ | BU -- ^ 'TransitionalReservation': Burma+ | BV -- ^ Bouvet Island+ | BW -- ^ Botswana+ | BX -- ^ 'NotInUse': Benelux Trademarks and Design Offices+ | BY -- ^ Belarus+ | BZ -- ^ Belize++ | CA -- ^ Canada+ | CC -- ^ Cocos (Keeling) Islands (the)+ | CD -- ^ Congo (the Democratic Republic of the)+ | CF -- ^ Central African Republic (the)+ | CG -- ^ Congo (the)+ | CH -- ^ Switzerland+ | CI -- ^ Côte d'Ivoire+ | CK -- ^ Cook Islands (the)+ | CL -- ^ Chile+ | CM -- ^ Cameroon+ | CN -- ^ China+ | CO -- ^ Colombia+ | CP -- ^ 'ExceptionalReservation': Clipperton Island+ | CR -- ^ Costa Rica+ | CS -- ^ 'TransitionalReservation': Serbia and Montenegro; previously Czechoslovakia+ | CT -- ^ 'Withdrawn': Canton and Enderbury Islands (the)+ | CU -- ^ Cuba+ | CV -- ^ Cabo Verde+ | CW -- ^ Curaçao+ | CX -- ^ Christmas Island+ | CY -- ^ Cyprus+ | CZ -- ^ Czechia++ | DD -- ^ 'Withdrawn': German Democratic Republic (the)+ | DE -- ^ Germany+ | DG -- ^ 'ExceptionalReservation': Diego Garcia+ | DJ -- ^ Djibouti+ | DK -- ^ Denmark+ | DM -- ^ Dominica+ | DO -- ^ Dominican Republic (the)+ | DY -- ^ 'IndeterminateReservation': Benin (road vehicles); previously Dahomey+ | DZ -- ^ Algeria++ | EA -- ^ 'ExceptionalReservation': Ceuta & Melilla+ | EC -- ^ Ecuador+ | EE -- ^ Estonia+ | EF -- ^ 'NotInUse': European Community Patent Convention+ | EM -- ^ 'NotInUse': European Trademark Office+ | EP -- ^ 'NotInUse': European Patent Organization+ | EV -- ^ 'NotInUse': Eurasian Patent Organization+ | EW -- ^ 'IndeterminateReservation': Estonia (road vehicles)+ | EG -- ^ Egypt+ | EH -- ^ Western Sahara+ | ER -- ^ Eritrea+ | ES -- ^ Spain+ | ET -- ^ Ethiopia+ | EU -- ^ 'ExceptionalReservation': European Union (the)+ | EZ -- ^ 'ExceptionalReservation': Eurozone (the)++ | FI -- ^ Finland+ | FJ -- ^ Fiji+ | FK -- ^ Falkland Islands (the) [Malvinas]+ | FL -- ^ 'IndeterminateReservation': Liechtenstein (road vehicles)+ | FM -- ^ Micronesia (Federated States of)+ | FO -- ^ Faroe Islands (the)+ | FQ -- ^ 'Withdrawn': French Southern and Antarctic Territories (the)+ | FR -- ^ France+ | FX -- ^ 'ExceptionalReservation': France, Metropolitan++ | GA -- ^ Gabon+ | GB -- ^ United Kingdom of Great Britain and Northern Ireland (the)+ | GC -- ^ 'NotInUse': Patent Office of the Cooperation Council for the Arab States of the Gulf+ | GD -- ^ Grenada+ | GE -- ^ Georgia; previously Gilbert and Ellice Islands (the)+ | GF -- ^ French Guiana+ | GG -- ^ Guernsey+ | GH -- ^ Ghana+ | GI -- ^ Gibraltar+ | GL -- ^ Greenland+ | GM -- ^ Gambia (the)+ | GN -- ^ Guinea+ | GP -- ^ Guadeloupe+ | GQ -- ^ Equatorial Guinea+ | GR -- ^ Greece+ | GS -- ^ South Georgia and the South Sandwich Islands+ | GT -- ^ Guatemala+ | GU -- ^ Guam+ | GW -- ^ Guinea-Bissau+ | GY -- ^ Guyana++ | HK -- ^ Hong Kong+ | HM -- ^ Heard Island and McDonald Islands+ | HN -- ^ Honduras+ | HR -- ^ Croatia+ | HT -- ^ Haiti+ | HU -- ^ Hungary+ | HV -- ^ 'Withdrawn': Upper Volta++ | IB -- ^ 'NotInUse': World Intellectual Property Organization, International Bureau+ | IC -- ^ 'ExceptionalReservation': Canary Islands (the)+ | ID -- ^ Indonesia+ | IE -- ^ Ireland+ | IL -- ^ Israel+ | IM -- ^ Isle of Man+ | IN -- ^ India+ | IO -- ^ British Indian Ocean Territory (the)+ | IQ -- ^ Iraq+ | IR -- ^ Iran (Islamic Republic of)+ | IS -- ^ Iceland+ | IT -- ^ Italy++ | JA -- ^ 'IndeterminateReservation': Jamaica (road vehicles)+ | JE -- ^ Jersey+ | JM -- ^ Jamaica+ | JO -- ^ Jordan+ | JP -- ^ Japan+ | JT -- ^ 'Withdrawn': Johnston Island++ | KE -- ^ Kenya+ | KG -- ^ Kyrgyzstan+ | KH -- ^ Cambodia+ | KI -- ^ Kiribati+ | KM -- ^ Comoros (the)+ | KN -- ^ Saint Kitts and Nevis+ | KP -- ^ Korea (the Democratic People's Republic of)+ | KR -- ^ Korea (the Republic of)+ | KW -- ^ Kuwait+ | KY -- ^ Cayman Islands (the)+ | KZ -- ^ Kazakhstan++ | LA -- ^ Lao People's Democratic Republic (the)+ | LB -- ^ Lebanon+ | LC -- ^ Saint Lucia+ | LF -- ^ 'IndeterminateReservation': Lybia Fezzan (road vehicles)+ | LI -- ^ Liechtenstein+ | LK -- ^ Sri Lanka+ | LR -- ^ Liberia+ | LS -- ^ Lesotho+ | LT -- ^ Lithuania+ | LU -- ^ Luxembourg+ | LV -- ^ Latvia+ | LY -- ^ Libya++ | MA -- ^ Morocco+ | MC -- ^ Monaco+ | MD -- ^ Moldova (the Republic of)+ | ME -- ^ Montenegro+ | MF -- ^ Saint Martin (French part)+ | MG -- ^ Madagascar+ | MH -- ^ Marshall Islands (the)+ | MI -- ^ 'Withdrawn': Midway Islands (the)+ | MK -- ^ Macedonia (the former Yugoslav Republic of)+ | ML -- ^ Mali+ | MM -- ^ Myanmar+ | MN -- ^ Mongolia+ | MO -- ^ Macao+ | MP -- ^ Northern Mariana Islands (the)+ | MQ -- ^ Martinique+ | MR -- ^ Mauritania+ | MS -- ^ Montserrat+ | MT -- ^ Malta+ | MU -- ^ Mauritius+ | MV -- ^ Maldives+ | MW -- ^ Malawi+ | MX -- ^ Mexico+ | MY -- ^ Malaysia+ | MZ -- ^ Mozambique++ | NA -- ^ Namibia+ | NC -- ^ New Caledonia+ | NE -- ^ Niger (the)+ | NF -- ^ Norfolk Island+ | NG -- ^ Nigeria+ | NH -- ^ 'Withdrawn': New Hebrides+ | NI -- ^ Nicaragua+ | NL -- ^ Netherlands (the)+ | NO -- ^ Norway+ | NP -- ^ Nepal+ | NQ -- ^ 'Withdrawn': Dronning Maud Land+ | NR -- ^ Nauru+ | NT -- ^ 'TransitionalReservation': Saudi Arabian-Iraqi neutral zone (the)+ | NU -- ^ Niue+ | NZ -- ^ New Zealand++ | OA -- ^ 'NotInUse': African Intellectual Property Organization+ | OM -- ^ Oman++ | PA -- ^ Panama+ | PC -- ^ 'Withdrawn': Pacific Islands (Trust Territory of the)+ | PE -- ^ Peru+ | PF -- ^ French Polynesia+ | PG -- ^ Papua New Guinea+ | PH -- ^ Philippines (the)+ | PI -- ^ 'IndeterminateReservation': Philippines (road vehicles)+ | PK -- ^ Pakistan+ | PL -- ^ Poland+ | PM -- ^ Saint Pierre and Miquelon+ | PN -- ^ Pitcairn+ | PR -- ^ Puerto Rico+ | PS -- ^ Palestine, State of+ | PT -- ^ Portugal+ | PU -- ^ 'Withdrawn': United States Miscellaneous Pacific Islands (the)+ | PW -- ^ Palau+ | PY -- ^ Paraguay+ | PZ -- ^ 'Withdrawn': Panama Canal Zone (the)++ | QA -- ^ Qatar++ | RA -- ^ 'IndeterminateReservation': Argentina (road vehicles)+ | RB -- ^ 'IndeterminateReservation': Bolivia & Botswana (road vehicles)+ | RC -- ^ 'IndeterminateReservation': China (road vehicles)+ | RE -- ^ Réunion+ | RH -- ^ 'IndeterminateReservation': Haiti (road vehicles); previously Southern Rhodesia+ | RI -- ^ 'IndeterminateReservation': Indonesia (road vehicles)+ | RM -- ^ 'IndeterminateReservation': Madagascar (road vehicles)+ | RN -- ^ 'IndeterminateReservation': Niger (road vehicles)+ | RO -- ^ Romania+ | RP -- ^ 'IndeterminateReservation': Philippines (road vehicles)+ | RS -- ^ Serbia+ | RU -- ^ Russian Federation (the)+ | RW -- ^ Rwanda++ | SA -- ^ Saudi Arabia+ | SB -- ^ Solomon Islands+ | SC -- ^ Seychelles+ | SD -- ^ Sudan (the)+ | SE -- ^ Sweden+ | SF -- ^ 'IndeterminateReservation': Finland+ | SG -- ^ Singapore+ | SH -- ^ Saint Helena, Ascension and Tristan da Cunha+ | SI -- ^ Slovenia+ | SJ -- ^ Svalbard and Jan Mayen+ | SK -- ^ Slovakia; previously Sikkim+ | SL -- ^ Sierra Leone+ | SM -- ^ San Marino+ | SN -- ^ Senegal+ | SO -- ^ Somalia+ | SR -- ^ Suriname+ | SS -- ^ South Sudan+ | ST -- ^ Sao Tome and Principe+ | SU -- ^ 'ExceptionalReservation': USSR (the)+ | SV -- ^ El Salvador+ | SX -- ^ Sint Maarten (Dutch part)+ | SY -- ^ Syrian Arab Republic+ | SZ -- ^ Swaziland++ | TA -- ^ 'ExceptionalReservation': Tristan da Cunha+ | TC -- ^ Turks and Caicos Islands (the)+ | TD -- ^ Chad+ | TF -- ^ French Southern Territories (the)+ | TG -- ^ Togo+ | TH -- ^ Thailand+ | TJ -- ^ Tajikistan+ | TK -- ^ Tokelau+ | TL -- ^ Timor-Leste+ | TM -- ^ Turkmenistan+ | TN -- ^ Tunisia+ | TO -- ^ Tonga+ | TR -- ^ Turkey+ | TP -- ^ 'TransitionalReservation': East Timor+ | TT -- ^ Trinidad and Tobago+ | TV -- ^ Tuvalu+ | TW -- ^ Taiwan (Province of China)+ | TZ -- ^ Tanzania, United Republic of++ | UA -- ^ Ukraine+ | UG -- ^ Uganda+ | UK -- ^ 'ExceptionalReservation': United Kingdom (the)+ | UM -- ^ United States Minor Outlying Islands (the)+ | UN -- ^ 'ExceptionalReservation': United Nations (the)+ | US -- ^ United States of America (the)+ | UY -- ^ Uruguay+ | UZ -- ^ Uzbekistan++ | VA -- ^ Holy See (the)+ | VC -- ^ Saint Vincent and the Grenadines+ | VD -- ^ 'Withdrawn': Viet Nam (Democratic Republic of)+ | VE -- ^ Venezuela (Bolivarian Republic of)+ | VG -- ^ Virgin Islands (British)+ | VI -- ^ Virgin Islands (U.S.)+ | VN -- ^ Viet Nam+ | VU -- ^ Vanuatu++ | WF -- ^ Wallis and Futuna+ | WG -- ^ 'IndeterminateReservation': Grenada (road vehicles)+ | WK -- ^ 'Withdrawn': Wake Island+ | WL -- ^ 'IndeterminateReservation': Saint Lucia (road vehicles)+ | WO -- ^ 'NotInUse': World Intellectual Property Organization+ | WS -- ^ Samoa+ | WV -- ^ 'IndeterminateReservation': Saint Vincent (road vehicles)++ | YD -- ^ 'Withdrawn': Yemen (Democratic)+ | YE -- ^ Yemen+ | YT -- ^ Mayotte+ | YU -- ^ 'TransitionalReservation': Yugoslavia+ | YV -- ^ 'IndeterminateReservation': Venezuela (road vehicles)++ | ZA -- ^ South Africa+ | ZM -- ^ Zambia+ | ZR -- ^ 'TransitionalReservation': Zaire+ | ZW -- ^ Zimbabwe+ deriving ( Eq, Show, Read, Enum, Bounded )++instance H.Hashable Alpha2 where+ hashWithSalt = H.hashUsing fromEnum++-- | The stability of any particular country code.+codeStatus :: Alpha2 -> Status+codeStatus AC = ExceptionalReservation+codeStatus AN = TransitionalReservation+codeStatus AP = NotInUse+codeStatus BU = TransitionalReservation+codeStatus BX = NotInUse+codeStatus CP = ExceptionalReservation+codeStatus CS = TransitionalReservation+codeStatus CT = Withdrawn+codeStatus DD = Withdrawn+codeStatus DG = ExceptionalReservation+codeStatus DY = IndeterminateReservation+codeStatus EA = ExceptionalReservation+codeStatus EF = NotInUse+codeStatus EM = NotInUse+codeStatus EP = NotInUse+codeStatus EU = ExceptionalReservation+codeStatus EV = NotInUse+codeStatus EW = IndeterminateReservation+codeStatus EZ = ExceptionalReservation+codeStatus FL = IndeterminateReservation+codeStatus FQ = Withdrawn+codeStatus FX = ExceptionalReservation+codeStatus GC = NotInUse+codeStatus HV = Withdrawn+codeStatus IB = NotInUse+codeStatus IC = ExceptionalReservation+codeStatus JA = IndeterminateReservation+codeStatus JT = Withdrawn+codeStatus LF = IndeterminateReservation+codeStatus NT = TransitionalReservation+codeStatus MI = Withdrawn+codeStatus NH = Withdrawn+codeStatus NQ = Withdrawn+codeStatus OA = NotInUse+codeStatus PC = Withdrawn+codeStatus PI = IndeterminateReservation+codeStatus PU = Withdrawn+codeStatus PZ = Withdrawn+codeStatus RA = IndeterminateReservation+codeStatus RB = IndeterminateReservation+codeStatus RC = IndeterminateReservation+codeStatus RH = IndeterminateReservation+codeStatus RI = IndeterminateReservation+codeStatus RM = IndeterminateReservation+codeStatus RN = IndeterminateReservation+codeStatus RP = IndeterminateReservation+codeStatus SF = IndeterminateReservation+codeStatus SU = ExceptionalReservation+codeStatus TA = ExceptionalReservation+codeStatus TP = TransitionalReservation+codeStatus UK = ExceptionalReservation+codeStatus UN = ExceptionalReservation+codeStatus VD = Withdrawn+codeStatus WG = IndeterminateReservation+codeStatus WK = Withdrawn+codeStatus WL = IndeterminateReservation+codeStatus WO = NotInUse+codeStatus WV = IndeterminateReservation+codeStatus YD = Withdrawn+codeStatus YU = TransitionalReservation+codeStatus YV = IndeterminateReservation+codeStatus ZR = TransitionalReservation+codeStatus _ = Official
+ Data/Standards/ISO/Country/Primary/Alpha3.hs view
@@ -0,0 +1,519 @@+{- | Module : Data.Standards.ISO.Country.Primary.Alpha3+ - Description : The three-character country codes described by ISO 3166-1.+ - Copyright : (c) 2018 Samuel May+ - License : MPL-2.0+ - Maintainer : ag.eitilt@gmail.com+ - Stability : provisional+ - Portability : portable+ -}+module Data.Standards.ISO.Country.Primary.Alpha3+ ( Alpha3 ( .. )+ , Status ( .. )+ , codeStatus+ ) where++import Data.Standards.ISO.Country.Primary.Common++import qualified Data.Hashable as H++{-# DEPRECATED ANT "Divided into BES, CUW and SXM, or use ISO 3166-3 code ANHH" #-}+{-# DEPRECATED BUR "Use new code MMR or ISO 3166-3 code BUMM" #-}+{-# DEPRECATED BYS "Use new code BLR or ISO 3166-3 code BYAA" #-}+{-# DEPRECATED CSK "Divided into CZE and SVK, or use ISO 3166-3 code CSHH" #-}+{-# DEPRECATED NTZ "Divided between IRQ and SAU, or use ISO 3166-3 code NTHH" #-}+{-# DEPRECATED ROM "Use new code ROU" #-}+{-# DEPRECATED SCG "Divided into MNE and SRB, or use ISO 3166-3 code CSXX" #-}+{-# DEPRECATED TMP "Use new code TLS or ISO 3166-3 code TPTL" #-}+{-# DEPRECATED YUG "Use ISO 3166-3 code YUCS" #-}+{-# DEPRECATED ZAR "Use new code COD or ISO 3166-3 code ZRCD" #-}++{-# DEPRECATED ADN "Use new code YEM" #-}+{-# DEPRECATED BDS "Use official code BRB" #-}+{-# DEPRECATED BRU "Use official code BRN" #-}+{-# DEPRECATED CDN "Use official code CAN" #-}+{-# DEPRECATED EAK "Use official code KEN" #-}+{-# DEPRECATED EAT "Use code for entire country TZA" #-}+{-# DEPRECATED EAU "Use official code UGA" #-}+{-# DEPRECATED EAZ "Use code for entire country TZA" #-}+{-# DEPRECATED GBA "Use code for entire region GGY" #-}+{-# DEPRECATED GBG "Use official code GGY" #-}+{-# DEPRECATED GBJ "Use official code JEY" #-}+{-# DEPRECATED GBM "Use official code IMN" #-}+{-# DEPRECATED GBZ "Use official code GIB" #-}+{-# DEPRECATED GCA "Use official code GTM" #-}+{-# DEPRECATED HKJ "Use official code JOR" #-}+{-# DEPRECATED MAL "Use official code MYS" #-}+{-# DEPRECATED RCA "Use official code CAF" #-}+{-# DEPRECATED RCB "Use official code COG" #-}+{-# DEPRECATED RCH "Use official code CHL" #-}+{-# DEPRECATED RMM "Use official code MLI" #-}+{-# DEPRECATED RNR "Use official code ZMB" #-}+{-# DEPRECATED ROK "Use official code KOR" #-}+{-# DEPRECATED RSM "Use official code SMR" #-}+{-# DEPRECATED RSR "Use official code ZWE" #-}+{-# DEPRECATED SLO "Use official code SVN" #-}+{-# DEPRECATED SME "Use official code SUR" #-}+{-# DEPRECATED TMN "Use official code TKN" #-}+{-# DEPRECATED WAG "Use official code GMB" #-}+{-# DEPRECATED WAL "Use official code SLE" #-}+{-# DEPRECATED WAN "Use official code NGA" #-}+{-# DEPRECATED ZRE "Use official code ZAR, new code COD or ISO 3166-3 code ZRCD" #-}++{-# WARNING GBD,GBN,GBO,GBP,GBS,UNA,UNK,UNO "Not an official ISO 3166-1 code" #-}++{-# DEPRECATED AFI "Use new code DJI or ISO 3166-3 code AIDJ" #-}+{-# DEPRECATED ATB "Use new code ATA or ISO 3166-3 code BQAQ" #-}+{-# DEPRECATED ATN "Use new code ATA or ISO 3166-3 code NQAQ" #-}+{-# DEPRECATED CTE "Use new code KIR or ISO 3166-3 code CTKI" #-}+{-# DEPRECATED DDR "Use new code DEU or ISO 3166-3 code DDDE" #-}+{-# DEPRECATED DHY "Use new code BEN or ISO 3166-3 code DYBJ" #-}+{-# DEPRECATED GEL "Divided into KIR and TUV, or use ISO 3166-3 code GEHH" #-}+{-# DEPRECATED HVO "Use new code BFA or ISO 3166-3 code HVBF" #-}+{-# DEPRECATED JTN "Use new code UMI or ISO 3166-3 code JTUM" #-}+{-# DEPRECATED MID "Use new code UMI or ISO 3166-3 code MIUM" #-}+{-# DEPRECATED NHB "Use new code VUT or ISO 3166-3 code NHVU" #-}+{-# DEPRECATED PCI "Divided into FSM, MHL, MNP and PLW, or use ISO 3166-3 code PCHH" #-}+{-# DEPRECATED PCZ "Use new code PAN or ISO 3166-3 code PZPA" #-}+{-# DEPRECATED PHI "Use new code PHL" #-}+{-# DEPRECATED PUS "Use new code UMI or ISO 3166-3 code PUUM" #-}+{-# DEPRECATED RHO "Use new code ZWE or ISO 3166-3 code RHZW" #-}+{-# DEPRECATED SKM "Use new code IND or ISO 3166-3 code SKIN" #-}+{-# DEPRECATED VDR "Use new code VNM or ISO 3166-3 code VDVN" #-}+{-# DEPRECATED WAK "Use new code UMI or ISO 3166-3 code WKUM" #-}+{-# DEPRECATED YMD "Use new code YEM or ISO 3166-3 code YDYE" #-}++-- | The official codes for countries with less collisions and therefore more+-- similar to the full name, translated into a type-safe representation. Unless+-- otherwise specified, all codes are 'Official'.+data Alpha3+ = ABW -- ^ Aruba+ | ADN -- ^ 'IndeterminateReservation': Aden (road vehicles)+ | AFG -- ^ Afghanistan+ | AFI -- ^ 'Withdrawn': French Afar and Issas+ | AGO -- ^ Angola+ | AIA -- ^ Anguilla+ | ALA -- ^ Åland Islands+ | ALB -- ^ Albania+ | AND -- ^ Andorra+ | ANT -- ^ 'TransitionalReservation': Netherlands Antilles+ | ARE -- ^ United Arab Emirates (the)+ | ARG -- ^ Argentina+ | ARM -- ^ Armenia+ | ASC -- ^ 'ExceptionalReservation': Ascension Island+ | ASM -- ^ American Samoa+ | ATA -- ^ Antarctica+ | ATB -- ^ 'Withdrawn': British Antarctic Territory (the)+ | ATF -- ^ French Southern Territories (the)+ | ATG -- ^ Antigua and Barbuda+ | ATN -- ^ 'Withdrawn': Dronning Maud Land+ | AUS -- ^ Australia+ | AUT -- ^ Austria+ | AZE -- ^ Azerbaijan++ | BDI -- ^ Burundi+ | BDS -- ^ 'IndeterminateReservation': Barbados (road vehicles)+ | BEL -- ^ Belgium+ | BEN -- ^ Benin+ | BES -- ^ Bonaire, Sint Eustatius and Saba+ | BFA -- ^ Burkina Faso+ | BGD -- ^ Bangladesh+ | BGR -- ^ Bulgaria+ | BHR -- ^ Bahrain+ | BHS -- ^ Bahamas (the)+ | BIH -- ^ Bosnia and Herzegovina+ | BLM -- ^ Saint Barthélemy+ | BLR -- ^ Belarus+ | BLZ -- ^ Belize+ | BMU -- ^ Bermuda+ | BOL -- ^ Bolivia (Plurinational State of)+ | BRA -- ^ Brazil+ | BRB -- ^ Barbados+ | BRN -- ^ Brunei Darussalam+ | BRU -- ^ 'IndeterminateReservation': Brunai (road vehicles)+ | BTN -- ^ Bhutan+ | BUR -- ^ 'TransitionalReservation': Burma+ | BVT -- ^ Bouvet Island+ | BWA -- ^ Botswana+ | BYS -- ^ 'TransitionalReservation': Byelorussian SSR++ | CAF -- ^ Central African Republic (the)+ | CAN -- ^ Canada+ | CCK -- ^ Cocos (Keeling) Islands (the)+ | CDN -- ^ 'IndeterminateReservation': Canada (road vehicles)+ | CHE -- ^ Switzerland+ | CHL -- ^ Chile+ | CHN -- ^ China+ | CIV -- ^ Côte d'Ivoire+ | CMR -- ^ Cameroon+ | COD -- ^ Congo (the Democratic Republic of the)+ | COG -- ^ Congo (the)+ | COK -- ^ Cook Islands (the)+ | COL -- ^ Colombia+ | COM -- ^ Comoros (the)+ | CPT -- ^ 'ExceptionalReservation': Clipperton Island+ | CPV -- ^ Cabo Verde+ | CRI -- ^ Costa Rica+ | CSK -- ^ 'TransitionalReservation': Czechoslovakia+ | CTE -- ^ 'Withdrawn': Canton and Enderbury Islands (the)+ | CUB -- ^ Cuba+ | CUW -- ^ Curaçao+ | CXR -- ^ Christmas Island+ | CYM -- ^ Cayman Islands (the)+ | CYP -- ^ Cyprus+ | CZE -- ^ Czechia++ | DDR -- ^ 'Withdrawn': German Democratic Republic (the)+ | DEU -- ^ Germany+ | DGA -- ^ 'ExceptionalReservation': Diego Garcia+ | DHY -- ^ 'Withdrawn': Dahomey+ | DJI -- ^ Djibouti+ | DMA -- ^ Dominica+ | DNK -- ^ Denmark+ | DOM -- ^ Dominican Republic (the)+ | DZA -- ^ Algeria++ | EAK -- ^ 'IndeterminateReservation': Kenya (road vehicles)+ | EAT -- ^ 'IndeterminateReservation': Tanganyika (road vehicles)+ | EAU -- ^ 'IndeterminateReservation': Uganda (road vehicles)+ | EAZ -- ^ 'IndeterminateReservation': Zanzibar (road vehicles)+ | ECU -- ^ Ecuador+ | EGY -- ^ Egypt+ | ERI -- ^ Eritrea+ | ESH -- ^ Western Sahara+ | ESP -- ^ Spain+ | EST -- ^ Estonia+ | ETH -- ^ Ethiopia++ | FIN -- ^ Finland+ | FJI -- ^ Fiji+ | FLK -- ^ Falkland Islands (the) [Malvinas]+ | FRA -- ^ France+ | FRO -- ^ Faroe Islands (the)+ | FSM -- ^ Micronesia (Federated States of)+ | FXX -- ^ 'ExceptionalReservation': France, Metropolitan++ | GAB -- ^ Gabon+ | GBA -- ^ 'IndeterminateReservation': Alderney (road vehicles)+ | GBD -- ^ 'NotInUse': British Overseas Territories (passport)+ | GBG -- ^ 'IndeterminateReservation': Guernsey (road vehicles)+ | GBJ -- ^ 'IndeterminateReservation': Jersey (road vehicles)+ | GBM -- ^ 'IndeterminateReservation': Isle of Man (road vehicles)+ | GBN -- ^ 'NotInUse': Overseas British national (passport)+ | GBO -- ^ 'NotInUse': Overseas Britisn citizen (passport)+ | GBP -- ^ 'NotInUse': British protected person (passport)+ | GBR -- ^ United Kingdom of Great Britain and Northern Ireland (the)+ | GBS -- ^ 'NotInUse': British subject (passport)+ | GBZ -- ^ 'IndeterminateReservation': Gibraltar (road vehicles)+ | GCA -- ^ 'IndeterminateReservation': Guatemala (road vehicles)+ | GEO -- ^ Georgia+ | GEL -- ^ 'Withdrawn': Gilbert and Ellice Islands (the)+ | GGY -- ^ Guernsey+ | GHA -- ^ Ghana+ | GIB -- ^ Gibraltar+ | GIN -- ^ Guinea+ | GLP -- ^ Guadeloupe+ | GMB -- ^ Gambia (the)+ | GNB -- ^ Guinea-Bissau+ | GNQ -- ^ Equatorial Guinea+ | GRC -- ^ Greece+ | GRD -- ^ Grenada+ | GRL -- ^ Greenland+ | GTM -- ^ Guatemala+ | GUF -- ^ French Guiana+ | GUM -- ^ Guam+ | GUY -- ^ Guyana++ | HKJ -- ^ 'IndeterminateReservation': Jordan (road vehicles)+ | HKG -- ^ Hong Kong+ | HMD -- ^ Heard Island and McDonald Islands+ | HND -- ^ Honduras+ | HRV -- ^ Croatia+ | HTI -- ^ Haiti+ | HUN -- ^ Hungary+ | HVO -- ^ 'Withdrawn': Upper Volta++ | IDN -- ^ Indonesia+ | IMN -- ^ Isle of Man+ | IND -- ^ India+ | IOT -- ^ British Indian Ocean Territory (the)+ | IRL -- ^ Ireland+ | IRN -- ^ Iran (Islamic Republic of)+ | IRQ -- ^ Iraq+ | ISL -- ^ Iceland+ | ISR -- ^ Israel+ | ITA -- ^ Italy++ | JAM -- ^ Jamaica+ | JEY -- ^ Jersey+ | JOR -- ^ Jordan+ | JPN -- ^ Japan+ | JTN -- ^ 'Withdrawn': Johnston Island++ | KAZ -- ^ Kazakhstan+ | KEN -- ^ Kenya+ | KGZ -- ^ Kyrgyzstan+ | KHM -- ^ Cambodia+ | KIR -- ^ Kiribati+ | KNA -- ^ Saint Kitts and Nevis+ | KOR -- ^ Korea (the Republic of)+ | KWT -- ^ Kuwait++ | LAO -- ^ Lao People's Democratic Republic (the)+ | LBN -- ^ Lebanon+ | LBR -- ^ Liberia+ | LBY -- ^ Libya+ | LCA -- ^ Saint Lucia+ | LIE -- ^ Liechtenstein+ | LKA -- ^ Sri Lanka+ | LSO -- ^ Lesotho+ | LTU -- ^ Lithuania+ | LUX -- ^ Luxembourg+ | LVA -- ^ Latvia++ | MAC -- ^ Macao+ | MAF -- ^ Saint Martin (French part)+ | MAL -- ^ 'IndeterminateReservation': Malaysia (road vehicles)+ | MAR -- ^ Morocco+ | MCO -- ^ Monaco+ | MDA -- ^ Moldova (the Republic of)+ | MDG -- ^ Madagascar+ | MDV -- ^ Maldives+ | MEX -- ^ Mexico+ | MHL -- ^ Marshall Islands (the)+ | MID -- ^ 'Withdrawn': Midway Islands (the)+ | MKD -- ^ Macedonia (the former Yugoslav Republic of)+ | MLI -- ^ Mali+ | MLT -- ^ Malta+ | MMR -- ^ Myanmar+ | MNE -- ^ Montenegro+ | MNG -- ^ Mongolia+ | MNP -- ^ Northern Mariana Islands (the)+ | MOZ -- ^ Mozambique+ | MRT -- ^ Mauritania+ | MSR -- ^ Montserrat+ | MTQ -- ^ Martinique+ | MUS -- ^ Mauritius+ | MWI -- ^ Malawi+ | MYS -- ^ Malaysia+ | MYT -- ^ Mayotte++ | NAM -- ^ Namibia+ | NCL -- ^ New Caledonia+ | NER -- ^ Niger (the)+ | NFK -- ^ Norfolk Island+ | NGA -- ^ Nigeria+ | NHB -- ^ 'Withdrawn': New Hebrides+ | NIC -- ^ Nicaragua+ | NIU -- ^ Niue+ | NLD -- ^ Netherlands (the)+ | NOR -- ^ Norway+ | NPL -- ^ Nepal+ | NRU -- ^ Nauru+ | NTZ -- ^ 'TransitionalReservation': Saudi Arabian-Iraqi neutral zone (the)+ | NZL -- ^ New Zealand++ | OMN -- ^ Oman++ | PAK -- ^ Pakistan+ | PAN -- ^ Panama+ | PCN -- ^ Pitcairn+ | PCI -- ^ 'Withdrawn': Pacific Islands (Trust Territory of the)+ | PCZ -- ^ 'Withdrawn': Panama Canal Zone (the)+ | PER -- ^ Peru+ | PHI -- ^ 'Withdrawn': Philippines+ | PHL -- ^ Philippines (the)+ | PLW -- ^ Palau+ | PNG -- ^ Papua New Guinea+ | POL -- ^ Poland+ | PRI -- ^ Puerto Rico+ | PRK -- ^ Korea (the Democratic People's Republic of)+ | PRT -- ^ Portugal+ | PRY -- ^ Paraguay+ | PSE -- ^ Palestine, State of+ | PUS -- ^ 'Withdrawn': United States Miscellaneous Pacific Islands (the)+ | PYF -- ^ French Polynesia++ | QAT -- ^ Qatar++ | RCA -- ^ 'IndeterminateReservation': Central African Republic (road vehicles)+ | RCB -- ^ 'IndeterminateReservation': Congo, People's Republic of (road vehicles)+ | RCH -- ^ 'IndeterminateReservation': Chile (road vehicles)+ | REU -- ^ Réunion+ | RHO -- ^ 'Withdrawn': Southern Rhodesia+ | RMM -- ^ 'IndeterminateReservation': Mali (road vehicles)+ | RNR -- ^ 'IndeterminateReservation': Zambia (road vehicles)+ | ROK -- ^ 'IndeterminateReservation': Korea, Republic of (road vehicles)+ | ROM -- ^ 'TransitionalReservation': Romania+ | ROU -- ^ Romania+ | RSM -- ^ 'IndeterminateReservation': San Marino (road vehicles)+ | RSR -- ^ 'IndeterminateReservation': Zimbabwe (road vehicles)+ | RUS -- ^ Russian Federation (the)+ | RWA -- ^ Rwanda++ | SAU -- ^ Saudi Arabia+ | SCG -- ^ 'TransitionalReservation': Serbia and Montenegro+ | SDN -- ^ Sudan (the)+ | SEN -- ^ Senegal+ | SGP -- ^ Singapore+ | SGS -- ^ South Georgia and the South Sandwich Islands+ | SHN -- ^ Saint Helena, Ascension and Tristan da Cunha+ | SJM -- ^ Svalbard and Jan Mayen+ | SKM -- ^ 'Withdrawn': Sikkim+ | SLB -- ^ Solomon Islands+ | SLE -- ^ Sierra Leone+ | SLO -- ^ 'IndeterminateReservation': Slovenia (road vehicles)+ | SLV -- ^ El Salvador+ | SME -- ^ 'IndeterminateReservation': Suriname (road vehicles)+ | SMR -- ^ San Marino+ | SOM -- ^ Somalia+ | SPM -- ^ Saint Pierre and Miquelon+ | SRB -- ^ Serbia+ | SSD -- ^ South Sudan+ | STP -- ^ Sao Tome and Principe+ | SUN -- ^ 'ExceptionalReservation': USSR (the)+ | SUR -- ^ Suriname+ | SVK -- ^ Slovakia+ | SVN -- ^ Slovenia+ | SWE -- ^ Sweden+ | SWZ -- ^ Swaziland+ | SXM -- ^ Sint Maarten (Dutch part)+ | SYC -- ^ Seychelles+ | SYR -- ^ Syrian Arab Republic++ | TAA -- ^ 'ExceptionalReservation': Tristan da Cunha+ | TCA -- ^ Turks and Caicos Islands (the)+ | TCD -- ^ Chad+ | TGO -- ^ Togo+ | THA -- ^ Thailand+ | TJK -- ^ Tajikistan+ | TKL -- ^ Tokelau+ | TKM -- ^ Turkmenistan+ | TLS -- ^ Timor-Leste+ | TMN -- ^ 'IndeterminateReservation': Turkmenistan (road vehicles)+ | TMP -- ^ 'TransitionalReservation': East Timor+ | TON -- ^ Tonga+ | TTO -- ^ Trinidad and Tobago+ | TUN -- ^ Tunisia+ | TUR -- ^ Turkey+ | TUV -- ^ Tuvalu+ | TWN -- ^ Taiwan (Province of China)+ | TZA -- ^ Tanzania, United Republic of++ | UGA -- ^ Uganda+ | UKR -- ^ Ukraine+ | UMI -- ^ United States Minor Outlying Islands (the)+ | UNA -- ^ 'NotInUse': United Nations Specialized Agency (passport)+ | UNK -- ^ 'NotInUse': United Nations Interim Administration in Kosovo (passport)+ | UNO -- ^ 'NotInUse': United Nations (passport)+ | URY -- ^ Uruguay+ | USA -- ^ United States of America (the)+ | UZB -- ^ Uzbekistan++ | VAT -- ^ Holy See (the)+ | VCT -- ^ Saint Vincent and the Grenadines+ | VDR -- ^ 'Withdrawn': Viet Nam (Democratic Republic of)+ | VEN -- ^ Venezuela (Bolivarian Republic of)+ | VGB -- ^ Virgin Islands (British)+ | VIR -- ^ Virgin Islands (U.S.)+ | VNM -- ^ Viet Nam+ | VUT -- ^ Vanuatu++ | WAG -- ^ 'IndeterminateReservation': Gambia (road vehicles)+ | WAK -- ^ 'Withdrawn': Wake Island+ | WAL -- ^ 'IndeterminateReservation': Sierra Leone (road vehicles)+ | WAN -- ^ 'IndeterminateReservation': Nigeria (road vehicles)+ | WLF -- ^ Wallis and Futuna+ | WSM -- ^ Samoa++ | YEM -- ^ Yemen+ | YMD -- ^ 'Withdrawn': Yemen (Democratic)+ | YUG -- ^ 'TransitionalReservation': Yugoslavia++ | ZAF -- ^ South Africa+ | ZAR -- ^ 'TransitionalReservation': Zaire+ | ZMB -- ^ Zambia+ | ZRE -- ^ 'IndeterminateReservation': Zaire (road vehicles)+ | ZWE -- ^ Zimbabwe+ deriving ( Eq, Show, Read, Enum, Bounded )++instance H.Hashable Alpha3 where+ hashWithSalt = H.hashUsing fromEnum++-- | The stability of any particular country code.+codeStatus :: Alpha3 -> Status+codeStatus ADN = IndeterminateReservation+codeStatus AFI = Withdrawn+codeStatus ANT = TransitionalReservation+codeStatus ASC = ExceptionalReservation+codeStatus ATB = Withdrawn+codeStatus ATN = Withdrawn+codeStatus BDS = IndeterminateReservation+codeStatus BRU = IndeterminateReservation+codeStatus BUR = TransitionalReservation+codeStatus BYS = TransitionalReservation+codeStatus CDN = IndeterminateReservation+codeStatus CPT = ExceptionalReservation+codeStatus CSK = TransitionalReservation+codeStatus CTE = Withdrawn+codeStatus DDR = Withdrawn+codeStatus DGA = ExceptionalReservation+codeStatus DHY = Withdrawn+codeStatus EAK = IndeterminateReservation+codeStatus EAT = IndeterminateReservation+codeStatus EAU = IndeterminateReservation+codeStatus EAZ = IndeterminateReservation+codeStatus FXX = ExceptionalReservation+codeStatus GBA = IndeterminateReservation+codeStatus GBD = NotInUse+codeStatus GBG = IndeterminateReservation+codeStatus GBJ = IndeterminateReservation+codeStatus GBM = IndeterminateReservation+codeStatus GBN = NotInUse+codeStatus GBO = NotInUse+codeStatus GBP = NotInUse+codeStatus GBS = NotInUse+codeStatus GBZ = IndeterminateReservation+codeStatus GCA = IndeterminateReservation+codeStatus GEL = Withdrawn+codeStatus HKJ = IndeterminateReservation+codeStatus HVO = Withdrawn+codeStatus JTN = Withdrawn+codeStatus MAL = IndeterminateReservation+codeStatus MID = Withdrawn+codeStatus NHB = Withdrawn+codeStatus NTZ = TransitionalReservation+codeStatus PCI = Withdrawn+codeStatus PCZ = Withdrawn+codeStatus PHI = Withdrawn+codeStatus PUS = Withdrawn+codeStatus RCA = IndeterminateReservation+codeStatus RCB = IndeterminateReservation+codeStatus RCH = IndeterminateReservation+codeStatus RHO = Withdrawn+codeStatus RMM = IndeterminateReservation+codeStatus RNR = IndeterminateReservation+codeStatus ROK = IndeterminateReservation+codeStatus ROM = TransitionalReservation+codeStatus RSM = IndeterminateReservation+codeStatus RSR = IndeterminateReservation+codeStatus SCG = TransitionalReservation+codeStatus SKM = Withdrawn+codeStatus SLO = IndeterminateReservation+codeStatus SME = IndeterminateReservation+codeStatus SUN = ExceptionalReservation+codeStatus TAA = ExceptionalReservation+codeStatus TMN = IndeterminateReservation+codeStatus TMP = TransitionalReservation+codeStatus UNA = NotInUse+codeStatus UNK = NotInUse+codeStatus UNO = NotInUse+codeStatus VDR = Withdrawn+codeStatus WAG = IndeterminateReservation+codeStatus WAK = Withdrawn+codeStatus WAL = IndeterminateReservation+codeStatus WAN = IndeterminateReservation+codeStatus YMD = Withdrawn+codeStatus YUG = TransitionalReservation+codeStatus ZAR = TransitionalReservation+codeStatus ZRE = IndeterminateReservation+codeStatus _ = Official
+ Data/Standards/ISO/Country/Primary/Common.hs view
@@ -0,0 +1,32 @@+{- | Module : Data.Standards.ISO.Country.Primary.Common+ - Description : Types used by all representations described by ISO 3166-1.+ - Copyright : (c) 2018 Samuel May+ - License : MPL-2.0+ - Maintainer : ag.eitilt@gmail.com+ - Stability : stable+ - Portability : portable+ -}+module Data.Standards.ISO.Country.Primary.Common where++-- | Categories within the standard describing how much warning is given if a+-- code were to change or be replaced.+data Status+ -- | The code is active, and would only be replaced after a period as a+ -- 'TransitionalReservation'.+ = Official+ -- | The code is reserved and any other use is subject to approval.+ | ExceptionalReservation+ -- | The code has been marked for deletion, but is currently still reserved+ -- as implementations remove it or migrate to the replacement.+ | TransitionalReservation+ -- | Use of the code is restricted to historic vehicle registrations, but+ -- may still be reassigned at any point.+ | IndeterminateReservation+ -- | The code is used by another standard or high-profile organization, and+ -- will not be assigned in ISO 3166. Officially, these are listed as an+ -- 'IndeterminateReservation'.+ | NotInUse+ -- | The code was previously included in the standard, but the country it+ -- referred to has been reassigned or no longer exists, and so (unless it's+ -- 'Numeric') it may be reused at any point.+ | Withdrawn
+ Data/Standards/ISO/Country/Primary/Numeric.hs view
@@ -0,0 +1,921 @@+{- | Module : Data.Standards.ISO.Country.Primary.Numeric+ - Description : The numeric country codes described by ISO 3166-1.+ - Copyright : (c) 2018 Samuel May+ - License : MPL-2.0+ - Maintainer : ag.eitilt@gmail.com+ - Stability : provisional+ - Portability : portable+ -}+module Data.Standards.ISO.Country.Primary.Numeric+ ( Numeric ( .. )+ , Status ( .. )+ , codeStatus+ ) where++import Data.Standards.ISO.Country.Primary.Common++import qualified Data.Hashable as H+import qualified Text.Printf as P++{-# DEPRECATED C080 "Use new code C010 after merge with C216 and C260" #-}+{-# DEPRECATED C128 "Use new code C296" #-}+{-# DEPRECATED C200 "Divided into C203 and C703" #-}+{-# DEPRECATED C216 "Use new code C010 after merge with C080 and C260" #-}+{-# DEPRECATED C230 "Divided into C231 and C232" #-}+{-# DEPRECATED C249 "Use new code C250" #-}+{-# DEPRECATED C278 "Use new code C276 after merge with C280" #-}+{-# DEPRECATED C280 "Use new code C276 after merge with C278" #-}+{-# DEPRECATED C396 "Use new code C581 after merge with C488, C849 and C872" #-}+{-# DEPRECATED C488 "Use new code C581 after merge with C396, C849 and C872" #-}+{-# DEPRECATED C530 "Divided into C531, C535 and C534" #-}+{-# DEPRECATED C532 "Divided into C530 and C533" #-}+{-# DEPRECATED C536 "Divided between C368 and C682" #-}+{-# DEPRECATED C582 "Divided into C580, C583, C584 and C585" #-}+{-# DEPRECATED C590 "Use new code C591 after merge with C594" #-}+{-# DEPRECATED C594 "Use new code C591 after merge with C590" #-}+{-# DEPRECATED C658 "Divided between C659 and C660" #-}+{-# DEPRECATED C698 "Use new code C356" #-}+{-# DEPRECATED C714 "Use new code C704" #-}+{-# DEPRECATED C720 "Use new code C887 after merge with C886" #-}+{-# DEPRECATED C736 "Divided between C728 and C729" #-}+{-# DEPRECATED C810 "Divided into C031, C051, C233, C268, C398, C417, C428, C440, C498, C643, C762, C795 and C860" #-}+{-# DEPRECATED C849 "Use new code C581 after merge with C396, C488 and C872" #-}+{-# DEPRECATED C872 "Use new code C581 after merge with C396, C488 and C849" #-}+{-# DEPRECATED C886 "Use new code C887 after merge with C720" #-}+{-# DEPRECATED C890 "Divided into C070, C191, C705, C807 and C891" #-}+{-# DEPRECATED C891 "Divided into C499 and C688" #-}++-- | The official numeric codes for countries, preventing collisions but+-- using an arbitrary mapping, translated into a type-safe representation.+-- Unless otherwise specified, all codes are 'Official'.+data Numeric+ = C004 -- ^ Afghanistan+ | C008 -- ^ Albania+ | C010 -- ^ Antarctica+ | C012 -- ^ Algeria+ | C016 -- ^ American Samoa+ | C020 -- ^ Andorra+ | C024 -- ^ Angola+ | C028 -- ^ Antigua and Barbuda+ | C031 -- ^ Azerbaijan+ | C032 -- ^ Argentina+ | C036 -- ^ Australia+ | C040 -- ^ Austria+ | C044 -- ^ Bahamas (the)+ | C048 -- ^ Bahrain++ | C050 -- ^ Bangladesh+ | C051 -- ^ Armenia+ | C052 -- ^ Barbados+ | C056 -- ^ Belgium+ | C060 -- ^ Bermuda+ | C064 -- ^ Bhutan+ | C068 -- ^ Bolivia (Plurinational State of)+ | C070 -- ^ Bosnia and Herzegovina+ | C072 -- ^ Botswana+ | C074 -- ^ Bouvet Island+ | C076 -- ^ Brazil+ | C080 -- ^ 'Withdrawn': British Antarctic Territory (the)+ | C084 -- ^ Belize+ | C086 -- ^ British Indian Ocean Territory (the)+ | C090 -- ^ Solomon Islands+ | C092 -- ^ Virgin Islands (British)+ | C096 -- ^ Brunei Darussalam++ | C100 -- ^ Bulgaria+ | C104 -- ^ Myanmar+ | C108 -- ^ Burundi+ | C112 -- ^ Belarus+ | C116 -- ^ Cambodia+ | C120 -- ^ Cameroon+ | C124 -- ^ Canada+ | C128 -- ^ 'Withdrawn': Canton and Enderbury Islands (the)+ | C132 -- ^ Cabo Verde+ | C136 -- ^ Cayman Islands (the)+ | C140 -- ^ Central African Republic (the)+ | C144 -- ^ Sri Lanka+ | C148 -- ^ Chad++ | C152 -- ^ Chile+ | C156 -- ^ China+ | C158 -- ^ Taiwan (Province of China)+ | C162 -- ^ Christmas Island+ | C166 -- ^ Cocos (Keeling) Islands (the)+ | C170 -- ^ Colombia+ | C174 -- ^ Comoros (the)+ | C175 -- ^ Mayotte+ | C178 -- ^ Congo (the)+ | C180 -- ^ Congo (the Democratic Republic of the)+ | C184 -- ^ Cook Islands (the)+ | C188 -- ^ Costa Rica+ | C191 -- ^ Croatia+ | C192 -- ^ Cuba+ | C196 -- ^ Cyprus++ | C200 -- ^ 'Withdrawn': Czechoslovakia+ | C203 -- ^ Czechia+ | C204 -- ^ Benin+ | C208 -- ^ Denmark+ | C212 -- ^ Dominica+ | C214 -- ^ Dominican Republic (the)+ | C216 -- ^ 'Withdrawn': Dronning Maud Land+ | C218 -- ^ Ecuador+ | C222 -- ^ El Salvador+ | C226 -- ^ Equatorial Guinea+ | C230 -- ^ 'Withdrawn': Ethiopia+ | C231 -- ^ Ethiopia+ | C232 -- ^ Eritrea+ | C233 -- ^ Estonia+ | C234 -- ^ Faroe Islands (the)+ | C238 -- ^ Falkland Islands (the) [Malvinas]+ | C239 -- ^ South Georgia and the South Sandwich Islands+ | C242 -- ^ Fiji+ | C246 -- ^ Finland+ | C248 -- ^ à land Islands+ | C249 -- ^ 'Withdrawn': France, Metropolitan++ | C250 -- ^ France+ | C254 -- ^ French Guiana+ | C258 -- ^ French Polynesia+ | C260 -- ^ French Southern Territories (the)+ | C262 -- ^ Djibouti+ | C266 -- ^ Gabon+ | C268 -- ^ Georgia+ | C270 -- ^ Gambia (the)+ | C275 -- ^ Palestine, State of+ | C276 -- ^ Germany+ | C278 -- ^ 'Withdrawn': German Democratic Republic (the)+ | C280 -- ^ 'Withdrawn': Germany (Federal Republic of)+ | C288 -- ^ Ghana+ | C292 -- ^ Gibraltar+ | C296 -- ^ Kiribati++ | C300 -- ^ Greece+ | C304 -- ^ Greenland+ | C308 -- ^ Grenada+ | C312 -- ^ Guadeloupe+ | C316 -- ^ Guam+ | C320 -- ^ Guatemala+ | C324 -- ^ Guinea+ | C328 -- ^ Guyana+ | C332 -- ^ Haiti+ | C334 -- ^ Heard Island and McDonald Islands+ | C336 -- ^ Holy See (the)+ | C340 -- ^ Honduras+ | C344 -- ^ Hong Kong+ | C348 -- ^ Hungary++ | C352 -- ^ Iceland+ | C356 -- ^ India+ | C360 -- ^ Indonesia+ | C364 -- ^ Iran (Islamic Republic of)+ | C368 -- ^ Iraq+ | C372 -- ^ Ireland+ | C376 -- ^ Israel+ | C380 -- ^ Italy+ | C384 -- ^ Côte d'Ivoire+ | C388 -- ^ Jamaica+ | C392 -- ^ Japan+ | C396 -- ^ 'Withdrawn': Johnston Island+ | C398 -- ^ Kazakhstan++ | C400 -- ^ Jordan+ | C404 -- ^ Kenya+ | C408 -- ^ Korea (the Democratic People's Republic of)+ | C410 -- ^ Korea (the Republic of)+ | C414 -- ^ Kuwait+ | C417 -- ^ Kyrgyzstan+ | C418 -- ^ Lao People's Democratic Republic (the)+ | C422 -- ^ Lebanon+ | C426 -- ^ Lesotho+ | C428 -- ^ Latvia+ | C430 -- ^ Liberia+ | C434 -- ^ Libya+ | C438 -- ^ Liechtenstein+ | C440 -- ^ Lithuania+ | C442 -- ^ Luxembourg+ | C446 -- ^ Macao++ | C450 -- ^ Madagascar+ | C454 -- ^ Malawi+ | C458 -- ^ Malaysia+ | C462 -- ^ Maldives+ | C466 -- ^ Mali+ | C470 -- ^ Malta+ | C474 -- ^ Martinique+ | C478 -- ^ Mauritania+ | C480 -- ^ Mauritius+ | C484 -- ^ Mexico+ | C488 -- ^ 'Withdrawn': Midway Islands (the)+ | C492 -- ^ Monaco+ | C496 -- ^ Mongolia+ | C498 -- ^ Moldova (the Republic of)+ | C499 -- ^ Montenegro++ | C500 -- ^ Montserrat+ | C504 -- ^ Morocco+ | C508 -- ^ Mozambique+ | C512 -- ^ Oman+ | C516 -- ^ Namibia+ | C520 -- ^ Nauru+ | C524 -- ^ Nepal+ | C528 -- ^ Netherlands (the)+ | C530 -- ^ 'Withdrawn': Netherlands Antilles+ | C531 -- ^ Curaçao+ | C532 -- ^ 'Withdrawn': Netherlands Antilles+ | C533 -- ^ Aruba+ | C534 -- ^ Sint Maarten (Dutch part)+ | C535 -- ^ Bonaire, Sint Eustatius and Saba+ | C536 -- ^ 'Withdrawn': Saudi Arabian-Iraqi neutral zone (the)+ | C540 -- ^ New Caledonia+ | C548 -- ^ Vanuatu++ | C554 -- ^ New Zealand+ | C558 -- ^ Nicaragua+ | C562 -- ^ Niger (the)+ | C566 -- ^ Nigeria+ | C570 -- ^ Niue+ | C574 -- ^ Norfolk Island+ | C578 -- ^ Norway+ | C580 -- ^ Northern Mariana Islands (the)+ | C581 -- ^ United States Minor Outlying Islands (the)+ | C582 -- ^ 'Withdrawn': Pacific Islands (Trust Territory of the)+ | C583 -- ^ Micronesia (Federated States of)+ | C584 -- ^ Marshall Islands (the)+ | C585 -- ^ Palau+ | C586 -- ^ Pakistan+ | C590 -- ^ 'Withdrawn': Panama+ | C591 -- ^ Panama+ | C594 -- ^ 'Withdrawn': Panama Canal Zone (the)+ | C598 -- ^ Papua New Guinea++ | C600 -- ^ Paraguay+ | C604 -- ^ Peru+ | C608 -- ^ Philippines (the)+ | C612 -- ^ Pitcairn+ | C616 -- ^ Poland+ | C620 -- ^ Portugal+ | C624 -- ^ Guinea-Bissau+ | C626 -- ^ Timor-Leste+ | C630 -- ^ Puerto Rico+ | C634 -- ^ Qatar+ | C638 -- ^ Réunion+ | C642 -- ^ Romania+ | C643 -- ^ Russian Federation (the)+ | C646 -- ^ Rwanda++ | C652 -- ^ Saint Barthélemy+ | C654 -- ^ Saint Helena, Ascension and Tristan da Cunha+ | C658 -- ^ 'Withdrawn': Saint Kitts-Nevis-Anguilla+ | C659 -- ^ Saint Kitts and Nevis+ | C660 -- ^ Anguilla+ | C662 -- ^ Saint Lucia+ | C663 -- ^ Saint Martin (French part)+ | C666 -- ^ Saint Pierre and Miquelon+ | C670 -- ^ Saint Vincent and the Grenadines+ | C674 -- ^ San Marino+ | C678 -- ^ Sao Tome and Principe+ | C682 -- ^ Saudi Arabia+ | C686 -- ^ Senegal+ | C688 -- ^ Serbia+ | C690 -- ^ Seychelles+ | C694 -- ^ Sierra Leone+ | C698 -- ^ 'Withdrawn': Sikkim++ | C702 -- ^ Singapore+ | C703 -- ^ Slovakia+ | C704 -- ^ Viet Nam+ | C705 -- ^ Slovenia+ | C706 -- ^ Somalia+ | C710 -- ^ South Africa+ | C714 -- ^ 'Withdrawn': Viet Nam (Democratic Republic of)+ | C716 -- ^ Zimbabwe+ | C720 -- ^ 'Withdrawn': Yemen (Democratic)+ | C724 -- ^ Spain+ | C728 -- ^ South Sudan+ | C729 -- ^ Sudan (the)+ | C732 -- ^ Western Sahara+ | C736 -- ^ 'Withdrawn': Sudan (the)+ | C740 -- ^ Suriname+ | C744 -- ^ Svalbard and Jan Mayen+ | C748 -- ^ Swaziland++ | C752 -- ^ Sweden+ | C756 -- ^ Switzerland+ | C760 -- ^ Syrian Arab Republic+ | C762 -- ^ Tajikistan+ | C764 -- ^ Thailand+ | C768 -- ^ Togo+ | C772 -- ^ Tokelau+ | C776 -- ^ Tonga+ | C780 -- ^ Trinidad and Tobago+ | C784 -- ^ United Arab Emirates (the)+ | C788 -- ^ Tunisia+ | C792 -- ^ Turkey+ | C795 -- ^ Turkmenistan+ | C796 -- ^ Turks and Caicos Islands (the)+ | C798 -- ^ Tuvalu++ | C800 -- ^ Uganda+ | C804 -- ^ Ukraine+ | C807 -- ^ Macedonia (the former Yugoslav Republic of)+ | C810 -- ^ 'Withdrawn': USSR (the)+ | C818 -- ^ Egypt+ | C826 -- ^ United Kingdom of Great Britain and Northern Ireland (the)+ | C831 -- ^ Guernsey+ | C832 -- ^ Jersey+ | C833 -- ^ Isle of Man+ | C834 -- ^ Tanzania, United Republic of+ | C840 -- ^ United States of America (the)+ | C849 -- ^ 'Withdrawn': United States Miscellaneous Pacific Islands (the)++ | C850 -- ^ Virgin Islands (U.S.)+ | C854 -- ^ Burkina Faso+ | C858 -- ^ Uruguay+ | C860 -- ^ Uzbekistan+ | C862 -- ^ Venezuela (Bolivarian Republic of)+ | C872 -- ^ 'Withdrawn': Wake Island+ | C876 -- ^ Wallis and Futuna+ | C882 -- ^ Samoa+ | C886 -- ^ 'Withdrawn': Yemen Arab Republic+ | C887 -- ^ Yemen+ | C890 -- ^ 'Withdrawn': Yugoslavia (Socialist Federal Republic of)+ | C891 -- ^ 'Withdrawn': Serbia and Montenegro+ | C894 -- ^ Zambia+ deriving ( Eq, Show, Read, Bounded )++-- | The 'Int' values returned or processed by this instance are the true value+-- of the country code, rather than being incremental.+instance Enum Numeric where+ toEnum i = read $ 'C' : P.printf "%03d" i+ fromEnum = read . tail . show++ -- The derived instance takes a path through 'fromEnum' and 'toEnum' rather+ -- than using 'succ' and 'pred'. This seems like a bug, but if so, it's a+ -- bug in the Haskell Report not just GHC.+ -- + -- Relevant sections of the Report: 6.3.4 (which gives rules for 'enumFrom'+ -- and 'enumFromThen' based on 'enumFromTo' and 'enumFromThenTo' when also+ -- Bounded that GHC isn't following) and 11.2 (same as above, plus defaults+ -- for the latter based on 'Int' lists) as well as the definition in the+ -- Prelude (section 9; the same implementations as GHC despite all being+ -- 'Int' lists -- running into the same problem with 6.3.4 -- and having a+ -- note that explicitly says they only make sense for injective mappings).+ enumFrom = flip enumFromTo maxBound+ enumFromThen x y = enumFromThenTo x y bound+ where bound+ | fromEnum x <= fromEnum y = maxBound+ | otherwise = minBound++ enumFromTo x y+ | x == y = [x]+ | fromEnum x > fromEnum y = []+ | otherwise = x : enumFromTo (succ x) y++ enumFromThenTo x1 x2 y+ | x1 == y = []+ | otherwise = x1 : count x1 x2+ where count x1' x2'+ | (fromEnum x2' <= fromEnum y) /= forward = [x2]+ | x1' == x2 = enumFromThenTo x1' x2' y+ | forward = count (succ x1') (succ x2')+ | otherwise = count (pred x1') (pred x2')+ forward = fromEnum x1 < fromEnum x2++ --TODO: Depending on how the compiler transforms these, it might be better+ -- to put them into a lookup table; check with benchmarking.+ succ C004 = C008+ succ C008 = C010+ succ C010 = C012+ succ C012 = C016+ succ C016 = C020+ succ C020 = C024+ succ C024 = C028+ succ C028 = C031+ succ C032 = C036+ succ C036 = C040+ succ C040 = C044+ succ C044 = C048+ succ C048 = C050++ succ C052 = C056+ succ C056 = C060+ succ C060 = C064+ succ C064 = C068+ succ C068 = C070+ succ C070 = C072+ succ C072 = C074+ succ C074 = C076+ succ C076 = C080+ succ C080 = C084+ succ C084 = C086+ succ C086 = C090+ succ C090 = C092+ succ C092 = C096+ succ C096 = C100++ succ C100 = C104+ succ C104 = C108+ succ C108 = C112+ succ C112 = C116+ succ C116 = C120+ succ C120 = C124+ succ C124 = C128+ succ C128 = C132+ succ C132 = C136+ succ C136 = C140+ succ C140 = C144+ succ C144 = C148+ succ C148 = C152++ succ C152 = C156+ succ C156 = C158+ succ C158 = C162+ succ C162 = C166+ succ C166 = C170+ succ C170 = C174+ succ C175 = C178+ succ C178 = C180+ succ C180 = C184+ succ C184 = C188+ succ C188 = C191+ succ C192 = C196+ succ C196 = C200++ succ C200 = C203+ succ C204 = C208+ succ C208 = C212+ succ C212 = C214+ succ C214 = C216+ succ C216 = C218+ succ C218 = C222+ succ C222 = C226+ succ C226 = C230+ succ C234 = C238+ succ C239 = C242+ succ C242 = C246+ succ C246 = C248++ succ C250 = C254+ succ C254 = C258+ succ C258 = C260+ succ C260 = C262+ succ C262 = C266+ succ C266 = C268+ succ C268 = C270+ succ C270 = C275+ succ C276 = C278+ succ C278 = C280+ succ C280 = C288+ succ C288 = C292+ succ C292 = C296+ succ C296 = C300++ succ C300 = C304+ succ C304 = C308+ succ C308 = C312+ succ C312 = C316+ succ C316 = C320+ succ C320 = C324+ succ C324 = C328+ succ C328 = C332+ succ C332 = C334+ succ C334 = C336+ succ C336 = C340+ succ C340 = C344+ succ C344 = C348+ succ C348 = C352++ succ C352 = C356+ succ C356 = C360+ succ C360 = C364+ succ C364 = C368+ succ C368 = C372+ succ C372 = C376+ succ C376 = C380+ succ C380 = C384+ succ C384 = C388+ succ C388 = C392+ succ C392 = C396+ succ C396 = C398+ succ C398 = C400++ succ C400 = C404+ succ C404 = C408+ succ C408 = C410+ succ C410 = C414+ succ C414 = C417+ succ C418 = C422+ succ C422 = C426+ succ C426 = C428+ succ C428 = C430+ succ C430 = C434+ succ C434 = C438+ succ C438 = C440+ succ C440 = C442+ succ C442 = C446+ succ C446 = C450++ succ C450 = C454+ succ C454 = C458+ succ C458 = C462+ succ C462 = C466+ succ C466 = C470+ succ C470 = C474+ succ C474 = C478+ succ C478 = C480+ succ C480 = C484+ succ C484 = C488+ succ C488 = C492+ succ C492 = C496+ succ C496 = C498++ succ C500 = C504+ succ C504 = C508+ succ C508 = C512+ succ C512 = C516+ succ C516 = C520+ succ C520 = C524+ succ C524 = C528+ succ C528 = C530+ succ C536 = C540+ succ C540 = C548+ succ C548 = C554++ succ C554 = C558+ succ C558 = C562+ succ C562 = C566+ succ C566 = C570+ succ C570 = C574+ succ C574 = C578+ succ C578 = C580+ succ C586 = C590+ succ C591 = C594+ succ C594 = C598+ succ C598 = C600++ succ C600 = C604+ succ C604 = C608+ succ C608 = C612+ succ C612 = C616+ succ C616 = C620+ succ C620 = C624+ succ C624 = C626+ succ C626 = C630+ succ C630 = C634+ succ C634 = C638+ succ C638 = C642+ succ C643 = C646+ succ C646 = C652++ succ C652 = C654+ succ C654 = C658+ succ C660 = C662+ succ C663 = C666+ succ C666 = C670+ succ C670 = C674+ succ C674 = C678+ succ C678 = C682+ succ C682 = C686+ succ C686 = C688+ succ C688 = C690+ succ C690 = C694+ succ C694 = C698+ succ C698 = C702++ succ C706 = C710+ succ C710 = C714+ succ C714 = C716+ succ C716 = C720+ succ C720 = C724+ succ C724 = C728+ succ C729 = C732+ succ C732 = C736+ succ C736 = C740+ succ C740 = C744+ succ C744 = C748+ succ C748 = C752++ succ C752 = C756+ succ C756 = C760+ succ C760 = C762+ succ C762 = C764+ succ C764 = C768+ succ C768 = C772+ succ C772 = C776+ succ C776 = C780+ succ C780 = C784+ succ C784 = C788+ succ C788 = C792+ succ C792 = C795+ succ C796 = C798+ succ C798 = C800++ succ C800 = C804+ succ C804 = C807+ succ C807 = C810+ succ C810 = C818+ succ C818 = C826+ succ C826 = C831+ succ C834 = C840+ succ C840 = C849++ succ C850 = C854+ succ C854 = C858+ succ C858 = C860+ succ C860 = C862+ succ C862 = C872+ succ C872 = C876+ succ C876 = C882+ succ C882 = C886+ succ C887 = C890+ succ C891 = C894++ succ c+ | c == maxBound = error "tried to take `succ' of last tag in enumeration"+ | otherwise = toEnum . (+) 1 $ fromEnum c++ pred C008 = C004+ pred C010 = C008+ pred C012 = C010+ pred C016 = C012+ pred C020 = C016+ pred C024 = C020+ pred C028 = C024+ pred C031 = C028+ pred C036 = C032+ pred C040 = C036+ pred C044 = C040+ pred C048 = C044++ pred C050 = C048+ pred C056 = C052+ pred C060 = C056+ pred C064 = C060+ pred C068 = C064+ pred C070 = C068+ pred C072 = C070+ pred C074 = C072+ pred C076 = C074+ pred C080 = C076+ pred C084 = C080+ pred C086 = C084+ pred C090 = C086+ pred C092 = C090+ pred C096 = C092++ pred C100 = C096+ pred C104 = C100+ pred C108 = C104+ pred C112 = C108+ pred C116 = C112+ pred C120 = C116+ pred C124 = C120+ pred C128 = C124+ pred C132 = C128+ pred C136 = C132+ pred C140 = C136+ pred C144 = C140+ pred C148 = C144++ pred C152 = C148+ pred C156 = C152+ pred C158 = C156+ pred C162 = C158+ pred C166 = C162+ pred C170 = C166+ pred C174 = C170+ pred C178 = C175+ pred C180 = C178+ pred C184 = C180+ pred C188 = C184+ pred C191 = C188+ pred C196 = C192++ pred C200 = C196+ pred C203 = C200+ pred C208 = C204+ pred C212 = C208+ pred C214 = C212+ pred C216 = C214+ pred C218 = C216+ pred C222 = C218+ pred C226 = C222+ pred C230 = C226+ pred C238 = C234+ pred C242 = C239+ pred C246 = C242+ pred C248 = C246++ pred C254 = C250+ pred C258 = C254+ pred C260 = C258+ pred C262 = C260+ pred C266 = C262+ pred C268 = C266+ pred C270 = C268+ pred C275 = C270+ pred C278 = C276+ pred C280 = C278+ pred C288 = C280+ pred C292 = C288+ pred C296 = C292++ pred C300 = C296+ pred C304 = C300+ pred C308 = C304+ pred C312 = C308+ pred C316 = C312+ pred C320 = C316+ pred C324 = C320+ pred C328 = C324+ pred C332 = C328+ pred C334 = C332+ pred C336 = C334+ pred C340 = C336+ pred C344 = C340+ pred C348 = C344++ pred C352 = C348+ pred C356 = C352+ pred C360 = C356+ pred C364 = C360+ pred C368 = C364+ pred C372 = C368+ pred C376 = C372+ pred C380 = C376+ pred C384 = C380+ pred C388 = C384+ pred C392 = C388+ pred C396 = C392+ pred C398 = C396++ pred C400 = C398+ pred C404 = C400+ pred C408 = C404+ pred C410 = C408+ pred C414 = C410+ pred C417 = C414+ pred C422 = C418+ pred C426 = C422+ pred C428 = C426+ pred C430 = C428+ pred C434 = C430+ pred C438 = C434+ pred C440 = C438+ pred C442 = C440+ pred C446 = C442++ pred C450 = C446+ pred C454 = C450+ pred C458 = C454+ pred C462 = C458+ pred C466 = C462+ pred C470 = C466+ pred C474 = C470+ pred C478 = C474+ pred C480 = C478+ pred C484 = C480+ pred C488 = C484+ pred C492 = C488+ pred C496 = C492+ pred C498 = C496++ pred C504 = C500+ pred C508 = C504+ pred C512 = C508+ pred C516 = C512+ pred C520 = C516+ pred C524 = C520+ pred C528 = C524+ pred C530 = C528+ pred C540 = C536+ pred C548 = C540++ pred C554 = C548+ pred C558 = C554+ pred C562 = C558+ pred C566 = C562+ pred C570 = C566+ pred C574 = C570+ pred C578 = C574+ pred C580 = C578+ pred C590 = C586+ pred C594 = C591+ pred C598 = C594++ pred C600 = C598+ pred C604 = C600+ pred C608 = C604+ pred C612 = C608+ pred C616 = C612+ pred C620 = C616+ pred C624 = C620+ pred C626 = C624+ pred C630 = C626+ pred C634 = C630+ pred C638 = C634+ pred C642 = C638+ pred C646 = C643++ pred C652 = C646+ pred C654 = C652+ pred C658 = C654+ pred C662 = C660+ pred C666 = C663+ pred C670 = C666+ pred C674 = C670+ pred C678 = C674+ pred C682 = C678+ pred C686 = C682+ pred C688 = C686+ pred C690 = C688+ pred C694 = C690+ pred C698 = C694++ pred C702 = C698+ pred C710 = C706+ pred C714 = C710+ pred C716 = C714+ pred C720 = C716+ pred C724 = C720+ pred C728 = C724+ pred C732 = C729+ pred C736 = C732+ pred C740 = C736+ pred C744 = C740+ pred C748 = C744++ pred C752 = C748+ pred C756 = C752+ pred C760 = C756+ pred C762 = C760+ pred C764 = C762+ pred C768 = C764+ pred C772 = C768+ pred C776 = C772+ pred C780 = C776+ pred C784 = C780+ pred C788 = C784+ pred C792 = C788+ pred C795 = C792+ pred C798 = C796++ pred C800 = C798+ pred C804 = C800+ pred C807 = C804+ pred C810 = C807+ pred C818 = C810+ pred C826 = C818+ pred C831 = C826+ pred C840 = C834+ pred C849 = C840++ pred C854 = C850+ pred C858 = C854+ pred C860 = C858+ pred C862 = C860+ pred C872 = C862+ pred C876 = C872+ pred C882 = C876+ pred C886 = C882+ pred C890 = C887+ pred C894 = C891++ pred c+ | c == minBound = error "tried to take `pred' of first tag in enumeration"+ | otherwise = toEnum . subtract 1 $ fromEnum c++instance H.Hashable Numeric where+ hashWithSalt = H.hashUsing fromEnum++-- | The stability of any particular country code.+codeStatus :: Numeric -> Status+codeStatus C080 = Withdrawn+codeStatus C128 = Withdrawn+codeStatus C200 = Withdrawn+codeStatus C216 = Withdrawn+codeStatus C230 = Withdrawn+codeStatus C249 = Withdrawn+codeStatus C278 = Withdrawn+codeStatus C280 = Withdrawn+codeStatus C396 = Withdrawn+codeStatus C488 = Withdrawn+codeStatus C530 = Withdrawn+codeStatus C532 = Withdrawn+codeStatus C536 = Withdrawn+codeStatus C582 = Withdrawn+codeStatus C590 = Withdrawn+codeStatus C594 = Withdrawn+codeStatus C658 = Withdrawn+codeStatus C698 = Withdrawn+codeStatus C714 = Withdrawn+codeStatus C720 = Withdrawn+codeStatus C736 = Withdrawn+codeStatus C810 = Withdrawn+codeStatus C849 = Withdrawn+codeStatus C872 = Withdrawn+codeStatus C886 = Withdrawn+codeStatus C890 = Withdrawn+codeStatus C891 = Withdrawn+codeStatus _ = Official
+ Data/Standards/ISO/Country/Primary/Translation.hs view
@@ -0,0 +1,413 @@+{-# OPTIONS -Wno-deprecations #-}++{- | Module : Data.Standards.ISO.Country.Primary.Translation+ - Description : Convert between various code formats described by ISO 3166-1.+ - Copyright : (c) 2018 Samuel May+ - License : MPL-2.0+ - Maintainer : ag.eitilt@gmail.com+ - Stability : stable+ - Portability : portable+ -}+module Data.Standards.ISO.Country.Primary.Translation+ ( alpha2ToAlpha3+ , alpha2ToNumeric+ , alpha3ToAlpha2+ , alpha3ToNumeric+ , numericToAlpha2+ , numericToAlpha3+ ) where++import qualified Data.Standards.ISO.Country.Primary.Alpha2 as A2+import qualified Data.Standards.ISO.Country.Primary.Alpha3 as A3+import qualified Data.Standards.ISO.Country.Primary.Numeric as N++import qualified Data.HashMap.Lazy as M+import qualified Data.Maybe as Y++-- | Convert an 'Alpha2' country code to an 'Alpha3'.+alpha2ToAlpha3 :: A2.Alpha2 -> Maybe A3.Alpha3+alpha2ToAlpha3 = flip M.lookup a2a3++-- | Convert an 'Alpha2' country code to a 'Numeric'.+alpha2ToNumeric :: A2.Alpha2 -> Maybe N.Numeric+alpha2ToNumeric = flip M.lookup a2n++-- | Convert an 'Alpha3' country code to an 'Alpha2'.+alpha3ToAlpha2 :: A3.Alpha3 -> Maybe A2.Alpha2+alpha3ToAlpha2 = flip M.lookup a3a2++-- | Convert an 'Alpha3' country code to a 'Numeric'.+alpha3ToNumeric :: A3.Alpha3 -> Maybe N.Numeric+alpha3ToNumeric = flip M.lookup a3n++-- | Convert a 'Numeric' country code to an 'Alpha2'.+numericToAlpha2 :: N.Numeric -> Maybe A2.Alpha2+numericToAlpha2 = flip M.lookup na2++-- | Convert a 'Numeric' country code to an 'Alpha3'.+numericToAlpha3 :: N.Numeric -> Maybe A3.Alpha3+numericToAlpha3 = flip M.lookup na3++-- | The mappings between countries which have a unique code in all systems of+-- representation.+tuples :: [(Maybe A2.Alpha2, Maybe A3.Alpha3, Maybe N.Numeric)]+tuples =+ --TODO: Allow multiple mappings /to/ 'Numeric' for historic names, but only+ -- a single one /from/ it (the current).+ [ (Just A2.AC, Just A3.ASC, Nothing ) -- Ascension Island+ , (Just A2.AD, Just A3.AND, Just N.C020) -- Andorra+ , (Just A2.AE, Just A3.ARE, Just N.C784) -- United Arab Emirates (the)+ , (Just A2.AF, Just A3.AFG, Just N.C004) -- Afghanistan+ , (Just A2.AG, Just A3.ATG, Just N.C028) -- Antigua and Barbuda+ , (Just A2.AI, Just A3.AIA, Just N.C660) -- Anguilla+ , (Just A2.AL, Just A3.ALB, Just N.C008) -- Albania+ , (Just A2.AM, Just A3.ARM, Just N.C051) -- Armenia+ , (Just A2.AN, Just A3.ANT, Just N.C530) -- Netherlands Antilles+ , (Just A2.AO, Just A3.AGO, Just N.C024) -- Angola+ , (Just A2.AQ, Just A3.ATA, Just N.C010) -- Antarctica+ , (Just A2.AR, Just A3.ARG, Just N.C032) -- Argentina+ , (Just A2.AS, Just A3.ASM, Just N.C016) -- American Samoa+ , (Just A2.AT, Just A3.AUT, Just N.C040) -- Austria+ , (Just A2.AU, Just A3.AUS, Just N.C036) -- Australia+ , (Just A2.AW, Just A3.ABW, Just N.C533) -- Aruba+ , (Just A2.AX, Just A3.ALA, Just N.C248) -- Åland Islands+ , (Just A2.AZ, Just A3.AZE, Just N.C031) -- Azerbaijan++ , (Just A2.BA, Just A3.BIH, Just N.C070) -- Bosnia and Herzegovina+ , (Just A2.BB, Just A3.BRB, Just N.C052) -- Barbados+ , (Just A2.BD, Just A3.BGD, Just N.C050) -- Bangladesh+ , (Just A2.BE, Just A3.BEL, Just N.C056) -- Belgium+ , (Just A2.BF, Just A3.BFA, Just N.C854) -- Burkina Faso+ , (Just A2.BG, Just A3.BGR, Just N.C100) -- Bulgaria+ , (Just A2.BH, Just A3.BHR, Just N.C048) -- Bahrain+ , (Just A2.BI, Just A3.BDI, Just N.C108) -- Burundi+ , (Just A2.BJ, Just A3.BEN, Just N.C204) -- Benin+ , (Just A2.BL, Just A3.BLM, Just N.C652) -- Saint Barthélemy+ , (Just A2.BM, Just A3.BMU, Just N.C060) -- Bermuda+ , (Just A2.BN, Just A3.BRN, Just N.C096) -- Brunei Darussalam+ , (Just A2.BO, Just A3.BOL, Just N.C068) -- Bolivia (Plurinational State of)+ , (Nothing , Just A3.ATB, Just N.C080) -- British Antarctic Territory (the)+ , (Just A2.BQ, Just A3.BES, Just N.C535) -- Bonaire, Sint Eustatius and Saba+ , (Just A2.BR, Just A3.BRA, Just N.C076) -- Brazil+ , (Just A2.BS, Just A3.BHS, Just N.C044) -- Bahamas (the)+ , (Just A2.BT, Just A3.BTN, Just N.C064) -- Bhutan+ , (Just A2.BU, Just A3.BUR, Nothing ) -- Burma+ , (Just A2.BV, Just A3.BVT, Just N.C074) -- Bouvet Island+ , (Just A2.BW, Just A3.BWA, Just N.C072) -- Botswana+ , (Just A2.BY, Just A3.BLR, Just N.C112) -- Belarus+ , (Just A2.BZ, Just A3.BLZ, Just N.C084) -- Belize++ , (Just A2.CA, Just A3.CAN, Just N.C124) -- Canada+ , (Just A2.CC, Just A3.CCK, Just N.C166) -- Cocos (Keeling) Islands (the)+ , (Just A2.CD, Just A3.COD, Just N.C180) -- Congo (the Democratic Republic of the)+ , (Just A2.CF, Just A3.CAF, Just N.C140) -- Central African Republic (the)+ , (Just A2.CG, Just A3.COG, Just N.C178) -- Congo (the)+ , (Just A2.CH, Just A3.CHE, Just N.C756) -- Switzerland+ , (Just A2.CI, Just A3.CIV, Just N.C384) -- Côte d'Ivoire+ , (Just A2.CK, Just A3.COK, Just N.C184) -- Cook Islands (the)+ , (Just A2.CL, Just A3.CHL, Just N.C152) -- Chile+ , (Just A2.CM, Just A3.CMR, Just N.C120) -- Cameroon+ , (Just A2.CN, Just A3.CHN, Just N.C156) -- China+ , (Just A2.CO, Just A3.COL, Just N.C170) -- Colombia+ , (Just A2.CP, Just A3.CPT, Nothing ) -- Clipperton Island+ , (Just A2.CR, Just A3.CRI, Just N.C188) -- Costa Rica+ , (Nothing , Just A3.CSK, Just N.C200) -- Czechoslovakia+ , (Just A2.CS, Just A3.SCG, Just N.C891) -- Serbia and Montenegro+ , (Just A2.CT, Just A3.CTE, Just N.C128) -- Canton and Enderbury Islands (the)+ , (Just A2.CU, Just A3.CUB, Just N.C192) -- Cuba+ , (Just A2.CV, Just A3.CPV, Just N.C132) -- Cabo Verde+ , (Just A2.CW, Just A3.CUW, Just N.C531) -- Curaçao+ , (Just A2.CX, Just A3.CXR, Just N.C162) -- Christmas Island+ , (Just A2.CY, Just A3.CYP, Just N.C196) -- Cyprus+ , (Just A2.CZ, Just A3.CZE, Just N.C203) -- Czechia++ , (Just A2.DD, Just A3.DDR, Just N.C278) -- German Democratic Republic (the)+ , (Just A2.DE, Just A3.DEU, Just N.C276) -- Germany+ , (Just A2.DG, Just A3.DGA, Nothing ) -- Diego Garcia+ , (Just A2.DJ, Just A3.DJI, Just N.C262) -- Djibouti+ , (Just A2.DK, Just A3.DNK, Just N.C208) -- Denmark+ , (Just A2.DM, Just A3.DMA, Just N.C212) -- Dominica+ , (Just A2.DO, Just A3.DOM, Just N.C214) -- Dominican Republic (the)+ , (Just A2.DZ, Just A3.DZA, Just N.C012) -- Algeria++ , (Just A2.EA, Nothing , Nothing ) -- Ceuta & Melilla+ , (Just A2.EC, Just A3.ECU, Just N.C218) -- Ecuador+ , (Just A2.EE, Just A3.EST, Just N.C233) -- Estonia+ , (Just A2.EG, Just A3.EGY, Just N.C818) -- Egypt+ , (Just A2.EH, Just A3.ESH, Just N.C732) -- Western Sahara+ , (Just A2.ER, Just A3.ERI, Just N.C232) -- Eritrea+ , (Just A2.ES, Just A3.ESP, Just N.C724) -- Spain+ , (Just A2.ET, Just A3.ETH, Just N.C231) -- Ethiopia+ , (Just A2.EU, Nothing , Nothing ) -- European Union+ , (Just A2.EZ, Nothing , Nothing ) -- Eurozone++ , (Just A2.FI, Just A3.FIN, Just N.C246) -- Finland+ , (Just A2.FJ, Just A3.FJI, Just N.C242) -- Fiji+ , (Just A2.FK, Just A3.FLK, Just N.C238) -- Falkland Islands (the) [Malvinas]+ , (Just A2.FM, Just A3.FSM, Just N.C583) -- Micronesia (Federated States of)+ , (Just A2.FO, Just A3.FRO, Just N.C234) -- Faroe Islands (the)+ , (Just A2.FR, Just A3.FRA, Just N.C250) -- France+ , (Just A2.FX, Just A3.FXX, Just N.C249) -- France, Metropolitan++ , (Just A2.GA, Just A3.GAB, Just N.C266) -- Gabon+ , (Just A2.GB, Just A3.GBR, Just N.C826) -- United Kingdom of Great Britain and Northern Ireland (the)+ , (Just A2.GD, Just A3.GRD, Just N.C308) -- Grenada+ , (Just A2.GE, Just A3.GEO, Just N.C268) -- Georgia+ , (Just A2.GF, Just A3.GUF, Just N.C254) -- French Guiana+ , (Just A2.GG, Just A3.GGY, Just N.C831) -- Guernsey+ , (Just A2.GH, Just A3.GHA, Just N.C288) -- Ghana+ , (Just A2.GI, Just A3.GIB, Just N.C292) -- Gibraltar+ , (Just A2.GL, Just A3.GRL, Just N.C304) -- Greenland+ , (Just A2.GM, Just A3.GMB, Just N.C270) -- Gambia (the)+ , (Just A2.GN, Just A3.GIN, Just N.C324) -- Guinea+ , (Just A2.GP, Just A3.GLP, Just N.C312) -- Guadeloupe+ , (Just A2.GQ, Just A3.GNQ, Just N.C226) -- Equatorial Guinea+ , (Just A2.GR, Just A3.GRC, Just N.C300) -- Greece+ , (Just A2.GS, Just A3.SGS, Just N.C239) -- South Georgia and the South Sandwich Islands+ , (Just A2.GT, Just A3.GTM, Just N.C320) -- Guatemala+ , (Just A2.GU, Just A3.GUM, Just N.C316) -- Guam+ , (Just A2.GW, Just A3.GNB, Just N.C624) -- Guinea-Bissau+ , (Just A2.GY, Just A3.GUY, Just N.C328) -- Guyana++ , (Just A2.HK, Just A3.HKG, Just N.C344) -- Hong Kong+ , (Just A2.HM, Just A3.HMD, Just N.C334) -- Heard Island and McDonald Islands+ , (Just A2.HN, Just A3.HND, Just N.C340) -- Honduras+ , (Just A2.HR, Just A3.HRV, Just N.C191) -- Croatia+ , (Just A2.HT, Just A3.HTI, Just N.C332) -- Haiti+ , (Just A2.HU, Just A3.HUN, Just N.C348) -- Hungary+ , (Just A2.HV, Just A3.HVO, Nothing ) -- Upper Volta++ , (Just A2.IC, Nothing , Nothing ) -- Canary Islands+ , (Just A2.ID, Just A3.IDN, Just N.C360) -- Indonesia+ , (Just A2.IE, Just A3.IRL, Just N.C372) -- Ireland+ , (Just A2.IL, Just A3.ISR, Just N.C376) -- Israel+ , (Just A2.IM, Just A3.IMN, Just N.C833) -- Isle of Man+ , (Just A2.IN, Just A3.IND, Just N.C356) -- India+ , (Just A2.IO, Just A3.IOT, Just N.C086) -- British Indian Ocean Territory (the)+ , (Just A2.IQ, Just A3.IRQ, Just N.C368) -- Iraq+ , (Just A2.IR, Just A3.IRN, Just N.C364) -- Iran (Islamic Republic of)+ , (Just A2.IS, Just A3.ISL, Just N.C352) -- Iceland+ , (Just A2.IT, Just A3.ITA, Just N.C380) -- Italy++ , (Just A2.JE, Just A3.JEY, Just N.C832) -- Jersey+ , (Just A2.JM, Just A3.JAM, Just N.C388) -- Jamaica+ , (Just A2.JO, Just A3.JOR, Just N.C400) -- Jordan+ , (Just A2.JP, Just A3.JPN, Just N.C392) -- Japan+ , (Just A2.JT, Just A3.JTN, Just N.C396) -- Johnston Island++ , (Just A2.KE, Just A3.KEN, Just N.C404) -- Kenya+ , (Just A2.KG, Just A3.KGZ, Just N.C417) -- Kyrgyzstan+ , (Just A2.KH, Just A3.KHM, Just N.C116) -- Cambodia+ , (Just A2.KI, Just A3.KIR, Just N.C296) -- Kiribati+ , (Just A2.KM, Just A3.COM, Just N.C174) -- Comoros (the)+ , (Just A2.KN, Just A3.KNA, Just N.C659) -- Saint Kitts and Nevis+ , (Just A2.KP, Just A3.PRK, Just N.C408) -- Korea (the Democratic People's Republic of)+ , (Just A2.KR, Just A3.KOR, Just N.C410) -- Korea (the Republic of)+ , (Just A2.KW, Just A3.KWT, Just N.C414) -- Kuwait+ , (Just A2.KY, Just A3.CYM, Just N.C136) -- Cayman Islands (the)+ , (Just A2.KZ, Just A3.KAZ, Just N.C398) -- Kazakhstan++ , (Just A2.LA, Just A3.LAO, Just N.C418) -- Lao People's Democratic Republic (the)+ , (Just A2.LB, Just A3.LBN, Just N.C422) -- Lebanon+ , (Just A2.LC, Just A3.LCA, Just N.C662) -- Saint Lucia+ , (Just A2.LI, Just A3.LIE, Just N.C438) -- Liechtenstein+ , (Just A2.LK, Just A3.LKA, Just N.C144) -- Sri Lanka+ , (Just A2.LR, Just A3.LBR, Just N.C430) -- Liberia+ , (Just A2.LS, Just A3.LSO, Just N.C426) -- Lesotho+ , (Just A2.LT, Just A3.LTU, Just N.C440) -- Lithuania+ , (Just A2.LU, Just A3.LUX, Just N.C442) -- Luxembourg+ , (Just A2.LV, Just A3.LVA, Just N.C428) -- Latvia+ , (Just A2.LY, Just A3.LBY, Just N.C434) -- Libya++ , (Just A2.MA, Just A3.MAR, Just N.C504) -- Morocco+ , (Just A2.MC, Just A3.MCO, Just N.C492) -- Monaco+ , (Just A2.MD, Just A3.MDA, Just N.C498) -- Moldova (the Republic of)+ , (Just A2.ME, Just A3.MNE, Just N.C499) -- Montenegro+ , (Just A2.MF, Just A3.MAF, Just N.C663) -- Saint Martin (French part)+ , (Just A2.MG, Just A3.MDG, Just N.C450) -- Madagascar+ , (Just A2.MH, Just A3.MHL, Just N.C584) -- Marshall Islands (the)+ , (Just A2.MI, Just A3.MID, Just N.C488) -- Midway Islands (the)+ , (Just A2.MK, Just A3.MKD, Just N.C807) -- Macedonia (the former Yugoslav Republic of)+ , (Just A2.ML, Just A3.MLI, Just N.C466) -- Mali+ , (Just A2.MM, Just A3.MMR, Just N.C104) -- Myanmar+ , (Just A2.MN, Just A3.MNG, Just N.C496) -- Mongolia+ , (Just A2.MO, Just A3.MAC, Just N.C446) -- Macao+ , (Just A2.MP, Just A3.MNP, Just N.C580) -- Northern Mariana Islands (the)+ , (Just A2.MQ, Just A3.MTQ, Just N.C474) -- Martinique+ , (Just A2.MR, Just A3.MRT, Just N.C478) -- Mauritania+ , (Just A2.MS, Just A3.MSR, Just N.C500) -- Montserrat+ , (Just A2.MT, Just A3.MLT, Just N.C470) -- Malta+ , (Just A2.MU, Just A3.MUS, Just N.C480) -- Mauritius+ , (Just A2.MV, Just A3.MDV, Just N.C462) -- Maldives+ , (Just A2.MW, Just A3.MWI, Just N.C454) -- Malawi+ , (Just A2.MX, Just A3.MEX, Just N.C484) -- Mexico+ , (Just A2.MY, Just A3.MYS, Just N.C458) -- Malaysia+ , (Just A2.MZ, Just A3.MOZ, Just N.C508) -- Mozambique++ , (Just A2.NA, Just A3.NAM, Just N.C516) -- Namibia+ , (Just A2.NC, Just A3.NCL, Just N.C540) -- New Caledonia+ , (Just A2.NE, Just A3.NER, Just N.C562) -- Niger (the)+ , (Just A2.NF, Just A3.NFK, Just N.C574) -- Norfolk Island+ , (Just A2.NG, Just A3.NGA, Just N.C566) -- Nigeria+ , (Just A2.NH, Just A3.NHB, Nothing ) -- New Hebrides+ , (Just A2.NI, Just A3.NIC, Just N.C558) -- Nicaragua+ , (Just A2.NL, Just A3.NLD, Just N.C528) -- Netherlands (the)+ , (Just A2.NO, Just A3.NOR, Just N.C578) -- Norway+ , (Just A2.NP, Just A3.NPL, Just N.C524) -- Nepal+ , (Just A2.NQ, Just A3.ATN, Just N.C216) -- Dronning Maud Land+ , (Just A2.NR, Just A3.NRU, Just N.C520) -- Nauru+ , (Just A2.NT, Just A3.NTZ, Just N.C536) -- Saudi Arabian-Iraqi neutral zone (the)+ , (Just A2.NU, Just A3.NIU, Just N.C570) -- Niue+ , (Just A2.NZ, Just A3.NZL, Just N.C554) -- New Zealand++ , (Just A2.OM, Just A3.OMN, Just N.C512) -- Oman++ , (Just A2.PA, Just A3.PAN, Just N.C591) -- Panama+ , (Just A2.PC, Just A3.PCI, Just N.C582) -- Pacific Islands (Trust Territory of the)+ , (Just A2.PE, Just A3.PER, Just N.C604) -- Peru+ , (Just A2.PF, Just A3.PYF, Just N.C258) -- French Polynesia+ , (Just A2.PG, Just A3.PNG, Just N.C598) -- Papua New Guinea+ , (Just A2.PH, Just A3.PHL, Just N.C608) -- Philippines (the)+ , (Just A2.PK, Just A3.PAK, Just N.C586) -- Pakistan+ , (Just A2.PL, Just A3.POL, Just N.C616) -- Poland+ , (Just A2.PM, Just A3.SPM, Just N.C666) -- Saint Pierre and Miquelon+ , (Just A2.PN, Just A3.PCN, Just N.C612) -- Pitcairn+ , (Just A2.PR, Just A3.PRI, Just N.C630) -- Puerto Rico+ , (Just A2.PS, Just A3.PSE, Just N.C275) -- Palestine, State of+ , (Just A2.PT, Just A3.PRT, Just N.C620) -- Portugal+ , (Just A2.PU, Just A3.PUS, Just N.C849) -- United States Miscellaneous Pacific Islands (the)+ , (Just A2.PW, Just A3.PLW, Just N.C585) -- Palau+ , (Just A2.PY, Just A3.PRY, Just N.C600) -- Paraguay+ , (Just A2.PZ, Just A3.PCZ, Just N.C594) -- Panama Canal Zone (the)++ , (Just A2.QA, Just A3.QAT, Just N.C634) -- Qatar++ , (Just A2.RE, Just A3.REU, Just N.C638) -- Réunion+ , (Just A2.RO, Just A3.ROU, Just N.C642) -- Romania+ , (Just A2.RS, Just A3.SRB, Just N.C688) -- Serbia+ , (Just A2.RU, Just A3.RUS, Just N.C643) -- Russian Federation (the)+ , (Just A2.RW, Just A3.RWA, Just N.C646) -- Rwanda++ , (Just A2.SA, Just A3.SAU, Just N.C682) -- Saudi Arabia+ , (Just A2.SB, Just A3.SLB, Just N.C090) -- Solomon Islands+ , (Just A2.SC, Just A3.SYC, Just N.C690) -- Seychelles+ , (Just A2.SD, Just A3.SDN, Just N.C729) -- Sudan (the)+ , (Just A2.SE, Just A3.SWE, Just N.C752) -- Sweden+ , (Just A2.SG, Just A3.SGP, Just N.C702) -- Singapore+ , (Just A2.SH, Just A3.SHN, Just N.C654) -- Saint Helena, Ascension and Tristan da Cunha+ , (Just A2.SI, Just A3.SVN, Just N.C705) -- Slovenia+ , (Just A2.SJ, Just A3.SJM, Just N.C744) -- Svalbard and Jan Mayen+ , (Nothing , Just A3.SKM, Just N.C698) -- Sikkim+ , (Just A2.SK, Just A3.SVK, Just N.C703) -- Slovakia+ , (Just A2.SL, Just A3.SLE, Just N.C694) -- Sierra Leone+ , (Just A2.SM, Just A3.SMR, Just N.C674) -- San Marino+ , (Just A2.SN, Just A3.SEN, Just N.C686) -- Senegal+ , (Just A2.SO, Just A3.SOM, Just N.C706) -- Somalia+ , (Just A2.SR, Just A3.SUR, Just N.C740) -- Suriname+ , (Just A2.SS, Just A3.SSD, Just N.C728) -- South Sudan+ , (Just A2.ST, Just A3.STP, Just N.C678) -- Sao Tome and Principe+ , (Just A2.SV, Just A3.SLV, Just N.C222) -- El Salvador+ , (Just A2.SU, Just A3.SUN, Just N.C810) -- USSR (the)+ , (Just A2.SX, Just A3.SXM, Just N.C534) -- Sint Maarten (Dutch part)+ , (Just A2.SY, Just A3.SYR, Just N.C760) -- Syrian Arab Republic+ , (Just A2.SZ, Just A3.SWZ, Just N.C748) -- Swaziland++ , (Just A2.TA, Just A3.TAA, Nothing ) -- Tristan da Cunha+ , (Just A2.TC, Just A3.TCA, Just N.C796) -- Turks and Caicos Islands (the)+ , (Just A2.TD, Just A3.TCD, Just N.C148) -- Chad+ , (Just A2.TF, Just A3.ATF, Just N.C260) -- French Southern Territories (the)+ , (Just A2.TG, Just A3.TGO, Just N.C768) -- Togo+ , (Just A2.TH, Just A3.THA, Just N.C764) -- Thailand+ , (Just A2.TJ, Just A3.TJK, Just N.C762) -- Tajikistan+ , (Just A2.TK, Just A3.TKL, Just N.C772) -- Tokelau+ , (Just A2.TL, Just A3.TLS, Just N.C626) -- Timor-Leste+ , (Just A2.TM, Just A3.TKM, Just N.C795) -- Turkmenistan+ , (Just A2.TN, Just A3.TUN, Just N.C788) -- Tunisia+ , (Just A2.TO, Just A3.TON, Just N.C776) -- Tonga+ , (Just A2.TR, Just A3.TUR, Just N.C792) -- Turkey+ , (Just A2.TP, Just A3.TMP, Nothing ) -- East Timor+ , (Just A2.TT, Just A3.TTO, Just N.C780) -- Trinidad and Tobago+ , (Just A2.TV, Just A3.TUV, Just N.C798) -- Tuvalu+ , (Just A2.TW, Just A3.TWN, Just N.C158) -- Taiwan (Province of China)+ , (Just A2.TZ, Just A3.TZA, Just N.C834) -- Tanzania, United Republic of++ , (Just A2.UA, Just A3.UKR, Just N.C804) -- Ukraine+ , (Just A2.UG, Just A3.UGA, Just N.C800) -- Uganda+ , (Just A2.UK, Nothing , Nothing ) -- United Kingdom+ , (Just A2.UM, Just A3.UMI, Just N.C581) -- United States Minor Outlying Islands (the)+ , (Just A2.UN, Nothing , Nothing ) -- United Nations+ , (Just A2.US, Just A3.USA, Just N.C840) -- United States of America (the)+ , (Just A2.UY, Just A3.URY, Just N.C858) -- Uruguay+ , (Just A2.UZ, Just A3.UZB, Just N.C860) -- Uzbekistan++ , (Just A2.VA, Just A3.VAT, Just N.C336) -- Holy See (the)+ , (Just A2.VC, Just A3.VCT, Just N.C670) -- Saint Vincent and the Grenadines+ , (Just A2.VD, Just A3.VDR, Just N.C714) -- Viet Nam (Democratic Republic of)+ , (Just A2.VE, Just A3.VEN, Just N.C862) -- Venezuela (Bolivarian Republic of)+ , (Just A2.VG, Just A3.VGB, Just N.C092) -- Virgin Islands (British)+ , (Just A2.VI, Just A3.VIR, Just N.C850) -- Virgin Islands (U.S.)+ , (Just A2.VN, Just A3.VNM, Just N.C704) -- Viet Nam+ , (Just A2.VU, Just A3.VUT, Just N.C548) -- Vanuatu++ , (Just A2.WF, Just A3.WLF, Just N.C876) -- Wallis and Futuna+ , (Just A2.WK, Just A3.WAK, Just N.C872) -- Wake Island+ , (Just A2.WS, Just A3.WSM, Just N.C882) -- Samoa++ , (Just A2.YD, Just A3.YMD, Just N.C720) -- Yemen (Democratic)+ , (Just A2.YE, Just A3.YEM, Just N.C887) -- Yemen+ , (Just A2.YT, Just A3.MYT, Just N.C175) -- Mayotte+ , (Just A2.YU, Just A3.YUG, Just N.C890) -- Yugoslavia++ , (Just A2.ZA, Just A3.ZAF, Just N.C710) -- South Africa+ , (Just A2.ZM, Just A3.ZMB, Just N.C894) -- Zambia+ , (Just A2.ZW, Just A3.ZWE, Just N.C716) -- Zimbabwe+ , (Just A2.ZR, Just A3.ZAR, Nothing ) -- Zaire+ ]++-- | Cache 'Alpha2' -> 'Alpha3' conversions, and provide faster lookup.+a2a3 :: M.HashMap A2.Alpha2 A3.Alpha3+a2a3 = M.fromList . flip Y.mapMaybe tuples+ $ \(ma2, ma3, _) -> do+ a2 <- ma2+ a3 <- ma3+ return (a2, a3)++-- | Cache 'Alpha2' -> 'Numeric' conversions, and provide faster lookup.+a2n :: M.HashMap A2.Alpha2 N.Numeric+a2n = M.fromList . flip Y.mapMaybe tuples+ $ \(ma2, _, mn) -> do+ a2 <- ma2+ n <- mn+ return (a2, n)++-- | Cache 'Alpha3' -> 'Alpha2' conversions, and provide faster lookup.+a3a2 :: M.HashMap A3.Alpha3 A2.Alpha2+a3a2 = M.fromList . flip Y.mapMaybe tuples+ $ \(ma2, ma3, _) -> do+ a2 <- ma2+ a3 <- ma3+ return (a3, a2)++-- | Cache 'Alpha3' -> 'Numeric' conversions, and provide faster lookup.+a3n :: M.HashMap A3.Alpha3 N.Numeric+a3n = M.fromList . flip Y.mapMaybe tuples+ $ \(_, ma3, mn) -> do+ a3 <- ma3+ n <- mn+ return (a3, n)++-- | Cache 'Numeric' -> 'Alpha2' conversions, and provide faster lookup.+na2 :: M.HashMap N.Numeric A2.Alpha2+na2 = M.fromList . flip Y.mapMaybe tuples+ $ \(ma2, _, mn) -> do+ a2 <- ma2+ n <- mn+ return (n, a2)++-- | Cache 'Numeric' -> 'Alpha3' conversions, and provide faster lookup.+na3 :: M.HashMap N.Numeric A3.Alpha3+na3 = M.fromList . flip Y.mapMaybe tuples+ $ \(_, ma3, mn) -> do+ a3 <- ma3+ n <- mn+ return (n, a3)
+ LICENSE view
@@ -0,0 +1,373 @@+Mozilla Public License Version 2.0+==================================++1. Definitions+--------------++1.1. "Contributor"+ means each individual or legal entity that creates, contributes to+ the creation of, or owns Covered Software.++1.2. "Contributor Version"+ means the combination of the Contributions of others (if any) used+ by a Contributor and that particular Contributor's Contribution.++1.3. "Contribution"+ means Covered Software of a particular Contributor.++1.4. "Covered Software"+ means Source Code Form to which the initial Contributor has attached+ the notice in Exhibit A, the Executable Form of such Source Code+ Form, and Modifications of such Source Code Form, in each case+ including portions thereof.++1.5. "Incompatible With Secondary Licenses"+ means++ (a) that the initial Contributor has attached the notice described+ in Exhibit B to the Covered Software; or++ (b) that the Covered Software was made available under the terms of+ version 1.1 or earlier of the License, but not also under the+ terms of a Secondary License.++1.6. "Executable Form"+ means any form of the work other than Source Code Form.++1.7. "Larger Work"+ means a work that combines Covered Software with other material, in+ a separate file or files, that is not Covered Software.++1.8. "License"+ means this document.++1.9. "Licensable"+ means having the right to grant, to the maximum extent possible,+ whether at the time of the initial grant or subsequently, any and+ all of the rights conveyed by this License.++1.10. "Modifications"+ means any of the following:++ (a) any file in Source Code Form that results from an addition to,+ deletion from, or modification of the contents of Covered+ Software; or++ (b) any new file in Source Code Form that contains any Covered+ Software.++1.11. "Patent Claims" of a Contributor+ means any patent claim(s), including without limitation, method,+ process, and apparatus claims, in any patent Licensable by such+ Contributor that would be infringed, but for the grant of the+ License, by the making, using, selling, offering for sale, having+ made, import, or transfer of either its Contributions or its+ Contributor Version.++1.12. "Secondary License"+ means either the GNU General Public License, Version 2.0, the GNU+ Lesser General Public License, Version 2.1, the GNU Affero General+ Public License, Version 3.0, or any later versions of those+ licenses.++1.13. "Source Code Form"+ means the form of the work preferred for making modifications.++1.14. "You" (or "Your")+ means an individual or a legal entity exercising rights under this+ License. For legal entities, "You" includes any entity that+ controls, is controlled by, or is under common control with You. For+ purposes of this definition, "control" means (a) the power, direct+ or indirect, to cause the direction or management of such entity,+ whether by contract or otherwise, or (b) ownership of more than+ fifty percent (50%) of the outstanding shares or beneficial+ ownership of such entity.++2. License Grants and Conditions+--------------------------------++2.1. Grants++Each Contributor hereby grants You a world-wide, royalty-free,+non-exclusive license:++(a) under intellectual property rights (other than patent or trademark)+ Licensable by such Contributor to use, reproduce, make available,+ modify, display, perform, distribute, and otherwise exploit its+ Contributions, either on an unmodified basis, with Modifications, or+ as part of a Larger Work; and++(b) under Patent Claims of such Contributor to make, use, sell, offer+ for sale, have made, import, and otherwise transfer either its+ Contributions or its Contributor Version.++2.2. Effective Date++The licenses granted in Section 2.1 with respect to any Contribution+become effective for each Contribution on the date the Contributor first+distributes such Contribution.++2.3. Limitations on Grant Scope++The licenses granted in this Section 2 are the only rights granted under+this License. No additional rights or licenses will be implied from the+distribution or licensing of Covered Software under this License.+Notwithstanding Section 2.1(b) above, no patent license is granted by a+Contributor:++(a) for any code that a Contributor has removed from Covered Software;+ or++(b) for infringements caused by: (i) Your and any other third party's+ modifications of Covered Software, or (ii) the combination of its+ Contributions with other software (except as part of its Contributor+ Version); or++(c) under Patent Claims infringed by Covered Software in the absence of+ its Contributions.++This License does not grant any rights in the trademarks, service marks,+or logos of any Contributor (except as may be necessary to comply with+the notice requirements in Section 3.4).++2.4. Subsequent Licenses++No Contributor makes additional grants as a result of Your choice to+distribute the Covered Software under a subsequent version of this+License (see Section 10.2) or under the terms of a Secondary License (if+permitted under the terms of Section 3.3).++2.5. Representation++Each Contributor represents that the Contributor believes its+Contributions are its original creation(s) or it has sufficient rights+to grant the rights to its Contributions conveyed by this License.++2.6. Fair Use++This License is not intended to limit any rights You have under+applicable copyright doctrines of fair use, fair dealing, or other+equivalents.++2.7. Conditions++Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted+in Section 2.1.++3. Responsibilities+-------------------++3.1. Distribution of Source Form++All distribution of Covered Software in Source Code Form, including any+Modifications that You create or to which You contribute, must be under+the terms of this License. You must inform recipients that the Source+Code Form of the Covered Software is governed by the terms of this+License, and how they can obtain a copy of this License. You may not+attempt to alter or restrict the recipients' rights in the Source Code+Form.++3.2. Distribution of Executable Form++If You distribute Covered Software in Executable Form then:++(a) such Covered Software must also be made available in Source Code+ Form, as described in Section 3.1, and You must inform recipients of+ the Executable Form how they can obtain a copy of such Source Code+ Form by reasonable means in a timely manner, at a charge no more+ than the cost of distribution to the recipient; and++(b) You may distribute such Executable Form under the terms of this+ License, or sublicense it under different terms, provided that the+ license for the Executable Form does not attempt to limit or alter+ the recipients' rights in the Source Code Form under this License.++3.3. Distribution of a Larger Work++You may create and distribute a Larger Work under terms of Your choice,+provided that You also comply with the requirements of this License for+the Covered Software. If the Larger Work is a combination of Covered+Software with a work governed by one or more Secondary Licenses, and the+Covered Software is not Incompatible With Secondary Licenses, this+License permits You to additionally distribute such Covered Software+under the terms of such Secondary License(s), so that the recipient of+the Larger Work may, at their option, further distribute the Covered+Software under the terms of either this License or such Secondary+License(s).++3.4. Notices++You may not remove or alter the substance of any license notices+(including copyright notices, patent notices, disclaimers of warranty,+or limitations of liability) contained within the Source Code Form of+the Covered Software, except that You may alter any license notices to+the extent required to remedy known factual inaccuracies.++3.5. Application of Additional Terms++You may choose to offer, and to charge a fee for, warranty, support,+indemnity or liability obligations to one or more recipients of Covered+Software. However, You may do so only on Your own behalf, and not on+behalf of any Contributor. You must make it absolutely clear that any+such warranty, support, indemnity, or liability obligation is offered by+You alone, and You hereby agree to indemnify every Contributor for any+liability incurred by such Contributor as a result of warranty, support,+indemnity or liability terms You offer. You may include additional+disclaimers of warranty and limitations of liability specific to any+jurisdiction.++4. Inability to Comply Due to Statute or Regulation+---------------------------------------------------++If it is impossible for You to comply with any of the terms of this+License with respect to some or all of the Covered Software due to+statute, judicial order, or regulation then You must: (a) comply with+the terms of this License to the maximum extent possible; and (b)+describe the limitations and the code they affect. Such description must+be placed in a text file included with all distributions of the Covered+Software under this License. Except to the extent prohibited by statute+or regulation, such description must be sufficiently detailed for a+recipient of ordinary skill to be able to understand it.++5. Termination+--------------++5.1. The rights granted under this License will terminate automatically+if You fail to comply with any of its terms. However, if You become+compliant, then the rights granted under this License from a particular+Contributor are reinstated (a) provisionally, unless and until such+Contributor explicitly and finally terminates Your grants, and (b) on an+ongoing basis, if such Contributor fails to notify You of the+non-compliance by some reasonable means prior to 60 days after You have+come back into compliance. Moreover, Your grants from a particular+Contributor are reinstated on an ongoing basis if such Contributor+notifies You of the non-compliance by some reasonable means, this is the+first time You have received notice of non-compliance with this License+from such Contributor, and You become compliant prior to 30 days after+Your receipt of the notice.++5.2. If You initiate litigation against any entity by asserting a patent+infringement claim (excluding declaratory judgment actions,+counter-claims, and cross-claims) alleging that a Contributor Version+directly or indirectly infringes any patent, then the rights granted to+You by any and all Contributors for the Covered Software under Section+2.1 of this License shall terminate.++5.3. In the event of termination under Sections 5.1 or 5.2 above, all+end user license agreements (excluding distributors and resellers) which+have been validly granted by You or Your distributors under this License+prior to termination shall survive termination.++************************************************************************+* *+* 6. Disclaimer of Warranty *+* ------------------------- *+* *+* Covered Software is provided under this License on an "as is" *+* basis, without warranty of any kind, either expressed, implied, or *+* statutory, including, without limitation, warranties that the *+* Covered Software is free of defects, merchantable, fit for a *+* particular purpose or non-infringing. The entire risk as to the *+* quality and performance of the Covered Software is with You. *+* Should any Covered Software prove defective in any respect, You *+* (not any Contributor) assume the cost of any necessary servicing, *+* repair, or correction. This disclaimer of warranty constitutes an *+* essential part of this License. No use of any Covered Software is *+* authorized under this License except under this disclaimer. *+* *+************************************************************************++************************************************************************+* *+* 7. Limitation of Liability *+* -------------------------- *+* *+* Under no circumstances and under no legal theory, whether tort *+* (including negligence), contract, or otherwise, shall any *+* Contributor, or anyone who distributes Covered Software as *+* permitted above, be liable to You for any direct, indirect, *+* special, incidental, or consequential damages of any character *+* including, without limitation, damages for lost profits, loss of *+* goodwill, work stoppage, computer failure or malfunction, or any *+* and all other commercial damages or losses, even if such party *+* shall have been informed of the possibility of such damages. This *+* limitation of liability shall not apply to liability for death or *+* personal injury resulting from such party's negligence to the *+* extent applicable law prohibits such limitation. Some *+* jurisdictions do not allow the exclusion or limitation of *+* incidental or consequential damages, so this exclusion and *+* limitation may not apply to You. *+* *+************************************************************************++8. Litigation+-------------++Any litigation relating to this License may be brought only in the+courts of a jurisdiction where the defendant maintains its principal+place of business and such litigation shall be governed by laws of that+jurisdiction, without reference to its conflict-of-law provisions.+Nothing in this Section shall prevent a party's ability to bring+cross-claims or counter-claims.++9. Miscellaneous+----------------++This License represents the complete agreement concerning the subject+matter hereof. If any provision of this License is held to be+unenforceable, such provision shall be reformed only to the extent+necessary to make it enforceable. Any law or regulation which provides+that the language of a contract shall be construed against the drafter+shall not be used to construe this License against a Contributor.++10. Versions of the License+---------------------------++10.1. New Versions++Mozilla Foundation is the license steward. Except as provided in Section+10.3, no one other than the license steward has the right to modify or+publish new versions of this License. Each version will be given a+distinguishing version number.++10.2. Effect of New Versions++You may distribute the Covered Software under the terms of the version+of the License under which You originally received the Covered Software,+or under the terms of any subsequent version published by the license+steward.++10.3. Modified Versions++If you create software not governed by this License, and you want to+create a new license for such software, you may create and use a+modified version of this License if you rename the license and remove+any references to the name of the license steward (except to note that+such modified license differs from this License).++10.4. Distributing Source Code Form that is Incompatible With Secondary+Licenses++If You choose to distribute Source Code Form that is Incompatible With+Secondary Licenses under the terms of this version of the License, the+notice described in Exhibit B of this License must be attached.++Exhibit A - Source Code Form License Notice+-------------------------------------------++ This Source Code Form is subject to the terms of the Mozilla Public+ License, v. 2.0. If a copy of the MPL was not distributed with this+ file, You can obtain one at http://mozilla.org/MPL/2.0/.++If it is not possible or desirable to put the notice in a particular+file, then You may include the notice in a location (such as a LICENSE+file in a relevant directory) where a recipient would be likely to look+for such a notice.++You may add additional accurate notices of copyright ownership.++Exhibit B - "Incompatible With Secondary Licenses" Notice+---------------------------------------------------------++ This Source Code Form is "Incompatible With Secondary Licenses", as+ defined by the Mozilla Public License, v. 2.0.
+ README.md view
@@ -0,0 +1,37 @@+A number of the ISO standards are particularly attractive to being implemented+as static data libraries: they describe short strings that are prone to error+if left as 'Text', but are large enough to strongly discourage rewriting them+for each project. It is no surprise, therefore, that this package is the+fourth on Hackage to implement ISO 3166-1:++* "Data.ISO3166\_CountryCodes" from+ [iso3166-country-codes](https://hackage.haskell.org/package/iso3166-country-codes)+* "Data.CountryCodes" from+ [country-codes](https://hackage.haskell.org/package/country-codes)+* "Country" from [country](https://hackage.haskell.org/package/country)++However, none of those options truly seemed to provide an ideal, /complete/+experience. Only one (`country`) provides all three code encodings, but it+doesn't expose constructors for pattern matching. None of them implement the+other two parts of ISO 3166 (region codes, and historic countries), and the+only package that makes an effort to do so ("Data.StateCodes" from+[state-codes](https://hackage.haskell.org/package/state-codes)) doesn't cover+anything beyond the US. Someone who only needs the alpha-2 codes ("CA") may+indeed find one of the existing packages sufficient, but for anyone who does+need the full power of ISO 3166-2, none of them would serve.++The lack of people who would actually find this useful is another matter.+(Eight packages using the simple alpha-2 codes from one or another of the+above, as of writing.)++This package is an attempt to package that standard -- and, eventually, others+like it -- in a consistent API based in standard Haskell; `fromEnum` rather+than `encodeNumeric`, for example.++The following standards are implemented:++* ISO 3166-1 (`Data.Standards.ISO.Country.Primary`)++ * alpha-2 (`Data.Standards.ISO.Country.Primary.Alpha2`)+ * alpha-3 (`Data.Standards.ISO.Country.Primary.Alpha3`)+ * numeric (`Data.Standards.ISO.Country.Primary.Numeric`)
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ data-standards.cabal view
@@ -0,0 +1,46 @@+name: data-standards+author: Samuel May+category: Data+synopsis: A collection of standards representable by simple data types.++copyright: (c) 2018 Samuel May+license: MPL-2.0+license-file: LICENSE++version: 0.1.0.0+stability: provisional+maintainer: ag.eitilt@gmail.com++homepage: https://github.com/ag-eitilt/data-standards+bug-reports: https://github.com/ag-eitilt/data-standards/issues++description: Type-safe representations of the country codes described by+ the ISO 3166-1 specification.++cabal-version: >=1.10+extra-source-files: ChangeLog.md+ , README.md+build-type: Simple+tested-with: GHC ==8.0.2++source-repository head+ type: git+ location: git://github.com/ag-eitilt/data-standards.git++source-repository this+ type: git+ location: git://github.com/ag-eitilt/data-standards.git+ tag: v0.1.0.0++library+ exposed-modules: Data.Standards.ISO.Country.Primary+ , Data.Standards.ISO.Country.Primary.Alpha2+ , Data.Standards.ISO.Country.Primary.Alpha3+ , Data.Standards.ISO.Country.Primary.Numeric+ , Data.Standards.ISO.Country.Primary.Translation+ other-modules: Data.Standards.ISO.Country.Primary.Common+ build-depends: base >=4.9 && <4.10+ , hashable >=1.2 && <1.3+ , unordered-containers <0.3+ default-language: Haskell98+ ghc-options: -Wall -Wcompat