aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/locale/territory.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/locale/territory.lux')
-rw-r--r--stdlib/source/lux/locale/territory.lux311
1 files changed, 0 insertions, 311 deletions
diff --git a/stdlib/source/lux/locale/territory.lux b/stdlib/source/lux/locale/territory.lux
deleted file mode 100644
index dfb20896c..000000000
--- a/stdlib/source/lux/locale/territory.lux
+++ /dev/null
@@ -1,311 +0,0 @@
-(.module:
- [lux #*
- [abstract
- [equivalence (#+ Equivalence)]
- [hash (#+ Hash)]]
- [data
- ["." text]]
- [type
- abstract]
- [macro
- ["." template]]])
-
-## https://en.wikipedia.org/wiki/ISO_3166-1
-(abstract: #export Territory
- {#name Text
- #short Text
- #long Text
- #code Nat}
-
- (template [<name> <field> <type>]
- [(def: #export <name>
- (-> Territory <type>)
- (|>> :representation
- (get@ <field>)))]
-
- [name #name Text]
- [short_code #short Text]
- [long_code #long Text]
- [numeric_code #code Nat]
- )
-
- (template [<short> <long> <number> <name> <main> <neighbor>+]
- [(def: #export <main>
- Territory
- (:abstraction {#name <name>
- #short <short>
- #long <long>
- #code <number>}))
-
- (`` (template [<neighbor>]
- [(def: #export <neighbor> Territory <main>)]
-
- (~~ (template.splice <neighbor>+))))]
-
- ["AF" "AFG" 004 "Afghanistan" afghanistan []]
- ["AX" "ALA" 248 "Åland Islands" aland_islands []]
- ["AL" "ALB" 008 "Albania" albania []]
- ["DZ" "DZA" 012 "Algeria" algeria []]
- ["AS" "ASM" 016 "American Samoa" american_samoa []]
- ["AD" "AND" 020 "Andorra" andorra []]
- ["AO" "AGO" 024 "Angola" angola []]
- ["AI" "AIA" 660 "Anguilla" anguilla []]
- ["AQ" "ATA" 010 "Antarctica" antarctica []]
- ["AG" "ATG" 028 "Antigua and Barbuda" antigua [[barbuda]]]
- ["AR" "ARG" 032 "Argentina" argentina []]
- ["AM" "ARM" 051 "Armenia" armenia []]
- ["AW" "ABW" 533 "Aruba" aruba []]
- ["AU" "AUS" 036 "Australia" australia []]
- ["AT" "AUT" 040 "Austria" austria []]
- ["AZ" "AZE" 031 "Azerbaijan" azerbaijan []]
- ["BS" "BHS" 044 "The Bahamas" the_bahamas []]
- ["BH" "BHR" 048 "Bahrain" bahrain []]
- ["BD" "BGD" 050 "Bangladesh" bangladesh []]
- ["BB" "BRB" 052 "Barbados" barbados []]
- ["BY" "BLR" 112 "Belarus" belarus []]
- ["BE" "BEL" 056 "Belgium" belgium []]
- ["BZ" "BLZ" 084 "Belize" belize []]
- ["BJ" "BEN" 204 "Benin" benin []]
- ["BM" "BMU" 060 "Bermuda" bermuda []]
- ["BT" "BTN" 064 "Bhutan" bhutan []]
- ["BO" "BOL" 068 "Bolivia" bolivia []]
- ["BQ" "BES" 535 "Bonaire, Sint Eustatius and Saba" bonaire [[sint_eustatius] [saba]]]
- ["BA" "BIH" 070 "Bosnia and Herzegovina" bosnia [[herzegovina]]]
- ["BW" "BWA" 072 "Botswana" botswana []]
- ["BV" "BVT" 074 "Bouvet Island" bouvet_island []]
- ["BR" "BRA" 076 "Brazil" brazil []]
- ["IO" "IOT" 086 "British Indian Ocean Territory" british_indian_ocean_territory []]
- ["BN" "BRN" 096 "Brunei Darussalam" brunei_darussalam []]
- ["BG" "BGR" 100 "Bulgaria" bulgaria []]
- ["BF" "BFA" 854 "Burkina Faso" burkina_faso []]
- ["BI" "BDI" 108 "Burundi" burundi []]
- ["CV" "CPV" 132 "Cape Verde" cape_verde []]
- ["KH" "KHM" 116 "Cambodia" cambodia []]
- ["CM" "CMR" 120 "Cameroon" cameroon []]
- ["CA" "CAN" 124 "Canada" canada []]
- ["KY" "CYM" 136 "Cayman Islands" cayman_islands []]
- ["CF" "CAF" 140 "Central African Republic" central_african_republic []]
- ["TD" "TCD" 148 "Chad" chad []]
- ["CL" "CHL" 152 "Chile" chile []]
- ["CN" "CHN" 156 "China" china []]
- ["CX" "CXR" 162 "Christmas Island" christmas_island []]
- ["CC" "CCK" 166 "Cocos (Keeling) Islands" cocos_islands []]
- ["CO" "COL" 170 "Colombia" colombia []]
- ["KM" "COM" 174 "Comoros" comoros []]
- ["CG" "COG" 178 "Congo" congo []]
- ["CD" "COD" 180 "Democratic Republic of the Congo" democratic_republic_of_the_congo []]
- ["CK" "COK" 184 "Cook Islands" cook_islands []]
- ["CR" "CRI" 188 "Costa Rica" costa_rica []]
- ["CI" "CIV" 384 "Ivory Coast" ivory_coast []]
- ["HR" "HRV" 191 "Croatia" croatia []]
- ["CU" "CUB" 192 "Cuba" cuba []]
- ["CW" "CUW" 531 "Curacao" curacao []]
- ["CY" "CYP" 196 "Cyprus" cyprus []]
- ["CZ" "CZE" 203 "Czech Republic" czech_republic []]
- ["DK" "DNK" 208 "Denmark" denmark []]
- ["DJ" "DJI" 262 "Djibouti" djibouti []]
- ["DM" "DMA" 212 "Dominica" dominica []]
- ["DO" "DOM" 214 "Dominican Republic" dominican_republic []]
- ["EC" "ECU" 218 "Ecuador" ecuador []]
- ["EG" "EGY" 818 "Egypt" egypt []]
- ["SV" "SLV" 222 "El Salvador" el_salvador []]
- ["GQ" "GNQ" 226 "Equatorial Guinea" equatorial_guinea []]
- ["ER" "ERI" 232 "Eritrea" eritrea []]
- ["EE" "EST" 233 "Estonia" estonia []]
- ["SZ" "SWZ" 748 "Eswatini" eswatini []]
- ["ET" "ETH" 231 "Ethiopia" ethiopia []]
- ["FK" "FLK" 238 "Falkland Islands" falkland_islands []]
- ["FO" "FRO" 234 "Faroe Islands" faroe_islands []]
- ["FJ" "FJI" 242 "Fiji" fiji []]
- ["FI" "FIN" 246 "Finland" finland []]
- ["FR" "FRA" 250 "France" france []]
- ["GF" "GUF" 254 "French Guiana" french_guiana []]
- ["PF" "PYF" 258 "French Polynesia" french_polynesia []]
- ["TF" "ATF" 260 "French Southern Territories" french_southern_territories []]
- ["GA" "GAB" 266 "Gabon" gabon []]
- ["GM" "GMB" 270 "The Gambia" the_gambia []]
- ["GE" "GEO" 268 "Georgia" georgia []]
- ["DE" "DEU" 276 "Germany" germany []]
- ["GH" "GHA" 288 "Ghana" ghana []]
- ["GI" "GIB" 292 "Gibraltar" gibraltar []]
- ["GR" "GRC" 300 "Greece" greece []]
- ["GL" "GRL" 304 "Greenland" greenland []]
- ["GD" "GRD" 308 "Grenada" grenada []]
- ["GP" "GLP" 312 "Guadeloupe" guadeloupe []]
- ["GU" "GUM" 316 "Guam" guam []]
- ["GT" "GTM" 320 "Guatemala" guatemala []]
- ["GG" "GGY" 831 "Guernsey" guernsey []]
- ["GN" "GIN" 324 "Guinea" guinea []]
- ["GW" "GNB" 624 "Guinea-Bissau" guinea_bissau []]
- ["GY" "GUY" 328 "Guyana" guyana []]
- ["HT" "HTI" 332 "Haiti" haiti []]
- ["HM" "HMD" 334 "Heard Island and McDonald Islands" heard_island [[mcdonald_islands]]]
- ["VA" "VAT" 336 "Vatican City" vatican_city []]
- ["HN" "HND" 340 "Honduras" honduras []]
- ["HK" "HKG" 344 "Hong Kong" hong_kong []]
- ["HU" "HUN" 348 "Hungary" hungary []]
- ["IS" "ISL" 352 "Iceland" iceland []]
- ["IN" "IND" 356 "India" india []]
- ["ID" "IDN" 360 "Indonesia" indonesia []]
- ["IR" "IRN" 364 "Iran" iran []]
- ["IQ" "IRQ" 368 "Iraq" iraq []]
- ["IE" "IRL" 372 "Ireland" ireland []]
- ["IM" "IMN" 833 "Isle of Man" isle_of_man []]
- ["IL" "ISR" 376 "Israel" israel []]
- ["IT" "ITA" 380 "Italy" italy []]
- ["JM" "JAM" 388 "Jamaica" jamaica []]
- ["JP" "JPN" 392 "Japan" japan []]
- ["JE" "JEY" 832 "Jersey" jersey []]
- ["JO" "JOR" 400 "Jordan" jordan []]
- ["KZ" "KAZ" 398 "Kazakhstan" kazakhstan []]
- ["KE" "KEN" 404 "Kenya" kenya []]
- ["KI" "KIR" 296 "Kiribati" kiribati []]
- ["KP" "PRK" 408 "North Korea" north_korea []]
- ["KR" "KOR" 410 "South Korea" south_korea []]
- ["KW" "KWT" 414 "Kuwait" kuwait []]
- ["KG" "KGZ" 417 "Kyrgyzstan" kyrgyzstan []]
- ["LA" "LAO" 418 "Laos" laos []]
- ["LV" "LVA" 428 "Latvia" latvia []]
- ["LB" "LBN" 422 "Lebanon" lebanon []]
- ["LS" "LSO" 426 "Lesotho" lesotho []]
- ["LR" "LBR" 430 "Liberia" liberia []]
- ["LY" "LBY" 434 "Libya" libya []]
- ["LI" "LIE" 438 "Liechtenstein" liechtenstein []]
- ["LT" "LTU" 440 "Lithuania" lithuania []]
- ["LU" "LUX" 442 "Luxembourg" luxembourg []]
- ["MO" "MAC" 446 "Macau" macau []]
- ["MK" "MKD" 807 "Macedonia" macedonia []]
- ["MG" "MDG" 450 "Madagascar" madagascar []]
- ["MW" "MWI" 454 "Malawi" malawi []]
- ["MY" "MYS" 458 "Malaysia" malaysia []]
- ["MV" "MDV" 462 "Maldives" maldives []]
- ["ML" "MLI" 466 "Mali" mali []]
- ["MT" "MLT" 470 "Malta" malta []]
- ["MH" "MHL" 584 "Marshall Islands" marshall_islands []]
- ["MQ" "MTQ" 474 "Martinique" martinique []]
- ["MR" "MRT" 478 "Mauritania" mauritania []]
- ["MU" "MUS" 480 "Mauritius" mauritius []]
- ["YT" "MYT" 175 "Mayotte" mayotte []]
- ["MX" "MEX" 484 "Mexico" mexico []]
- ["FM" "FSM" 583 "Micronesia" micronesia []]
- ["MD" "MDA" 498 "Moldova" moldova []]
- ["MC" "MCO" 492 "Monaco" monaco []]
- ["MN" "MNG" 496 "Mongolia" mongolia []]
- ["ME" "MNE" 499 "Montenegro" montenegro []]
- ["MS" "MSR" 500 "Montserrat" montserrat []]
- ["MA" "MAR" 504 "Morocco" morocco []]
- ["MZ" "MOZ" 508 "Mozambique" mozambique []]
- ["MM" "MMR" 104 "Myanmar" myanmar []]
- ["NA" "NAM" 516 "Namibia" namibia []]
- ["NR" "NRU" 520 "Nauru" nauru []]
- ["NP" "NPL" 524 "Nepal" nepal []]
- ["NL" "NLD" 528 "Netherlands" netherlands []]
- ["NC" "NCL" 540 "New Caledonia" new_caledonia []]
- ["NZ" "NZL" 554 "New Zealand" new_zealand []]
- ["NI" "NIC" 558 "Nicaragua" nicaragua []]
- ["NE" "NER" 562 "Niger" niger []]
- ["NG" "NGA" 566 "Nigeria" nigeria []]
- ["NU" "NIU" 570 "Niue" niue []]
- ["NF" "NFK" 574 "Norfolk Island" norfolk_island []]
- ["MP" "MNP" 580 "Northern Mariana Islands" northern_mariana_islands []]
- ["NO" "NOR" 578 "Norway" norway []]
- ["OM" "OMN" 512 "Oman" oman []]
- ["PK" "PAK" 586 "Pakistan" pakistan []]
- ["PW" "PLW" 585 "Palau" palau []]
- ["PS" "PSE" 275 "Palestine" palestine []]
- ["PA" "PAN" 591 "Panama" panama []]
- ["PG" "PNG" 598 "Papua New Guinea" papua_new_guinea []]
- ["PY" "PRY" 600 "Paraguay" paraguay []]
- ["PE" "PER" 604 "Peru" peru []]
- ["PH" "PHL" 608 "Philippines" philippines []]
- ["PN" "PCN" 612 "Pitcairn Islands" pitcairn_islands []]
- ["PL" "POL" 616 "Poland" poland []]
- ["PT" "PRT" 620 "Portugal" portugal []]
- ["PR" "PRI" 630 "Puerto Rico" puerto_rico []]
- ["QA" "QAT" 634 "Qatar" qatar []]
- ["RE" "REU" 638 "Reunion" reunion []]
- ["RO" "ROU" 642 "Romania" romania []]
- ["RU" "RUS" 643 "Russia" russia []]
- ["RW" "RWA" 646 "Rwanda" rwanda []]
- ["BL" "BLM" 652 "Saint Barthélemy" saint_barthelemy []]
- ["SH" "SHN" 654 "Saint Helena, Ascension and Tristan da Cunha" saint_helena [[ascension] [tristan_da_cunha]]]
- ["KN" "KNA" 659 "Saint Kitts and Nevis" saint_kitts [[nevis]]]
- ["LC" "LCA" 662 "Saint Lucia" saint_lucia []]
- ["MF" "MAF" 663 "Saint Martin" saint_martin []]
- ["PM" "SPM" 666 "Saint Pierre and Miquelon" saint_pierre [[miquelon]]]
- ["VC" "VCT" 670 "Saint Vincent and the Grenadines" saint_vincent [[the_grenadines]]]
- ["WS" "WSM" 882 "Samoa" samoa []]
- ["SM" "SMR" 674 "San Marino" san_marino []]
- ["ST" "STP" 678 "Sao Tome and Principe" sao_tome [[principe]]]
- ["SA" "SAU" 682 "Saudi Arabia" saudi_arabia []]
- ["SN" "SEN" 686 "Senegal" senegal []]
- ["RS" "SRB" 688 "Serbia" serbia []]
- ["SC" "SYC" 690 "Seychelles" seychelles []]
- ["SL" "SLE" 694 "Sierra Leone" sierra_leone []]
- ["SG" "SGP" 702 "Singapore" singapore []]
- ["SX" "SXM" 534 "Sint Maarten" sint_maarten []]
- ["SK" "SVK" 703 "Slovakia" slovakia []]
- ["SI" "SVN" 705 "Slovenia" slovenia []]
- ["SB" "SLB" 090 "Solomon Islands" solomon_islands []]
- ["SO" "SOM" 706 "Somalia" somalia []]
- ["ZA" "ZAF" 710 "South Africa" south_africa []]
- ["GS" "SGS" 239 "South Georgia and the South Sandwich Islands" south_georgia [[south_sandwich_islands]]]
- ["SS" "SSD" 728 "South Sudan" south_sudan []]
- ["ES" "ESP" 724 "Spain" spain []]
- ["LK" "LKA" 144 "Sri Lanka" sri_lanka []]
- ["SD" "SDN" 729 "Sudan" sudan []]
- ["SR" "SUR" 740 "Suriname" suriname []]
- ["SJ" "SJM" 744 "Svalbard and Jan Mayen" svalbard [[jan_mayen]]]
- ["SE" "SWE" 752 "Sweden" sweden []]
- ["CH" "CHE" 756 "Switzerland" switzerland []]
- ["SY" "SYR" 760 "Syria" syria []]
- ["TW" "TWN" 158 "Taiwan" taiwan []]
- ["TJ" "TJK" 762 "Tajikistan" tajikistan []]
- ["TZ" "TZA" 834 "Tanzania" tanzania []]
- ["TH" "THA" 764 "Thailand" thailand []]
- ["TL" "TLS" 626 "East Timor" east_timor []]
- ["TG" "TGO" 768 "Togo" togo []]
- ["TK" "TKL" 772 "Tokelau" tokelau []]
- ["TO" "TON" 776 "Tonga" tonga []]
- ["TT" "TTO" 780 "Trinidad and Tobago" trinidad [[tobago]]]
- ["TN" "TUN" 788 "Tunisia" tunisia []]
- ["TR" "TUR" 792 "Turkey" turkey []]
- ["TM" "TKM" 795 "Turkmenistan" turkmenistan []]
- ["TC" "TCA" 796 "Turks and Caicos Islands" turks [[caicos_islands]]]
- ["TV" "TUV" 798 "Tuvalu" tuvalu []]
- ["UG" "UGA" 800 "Uganda" uganda []]
- ["UA" "UKR" 804 "Ukraine" ukraine []]
- ["AE" "ARE" 784 "United Arab Emirates" united_arab_emirates []]
- ["GB" "GBR" 826 "United Kingdom of Great Britain and Northern Ireland" united_kingdom [[northern_ireland]]]
- ["US" "USA" 840 "United States of America" united_states_of_america []]
- ["UM" "UMI" 581 "United States Minor Outlying Islands" united_states_minor_outlying_islands []]
- ["UY" "URY" 858 "Uruguay" uruguay []]
- ["UZ" "UZB" 860 "Uzbekistan" uzbekistan []]
- ["VU" "VUT" 548 "Vanuatu" vanuatu []]
- ["VE" "VEN" 862 "Venezuela" venezuela []]
- ["VN" "VNM" 704 "Vietnam" vietnam []]
- ["VG" "VGB" 092 "British Virgin Islands" british_virgin_islands []]
- ["VI" "VIR" 850 "United States Virgin Islands" united_states_virgin_islands []]
- ["WF" "WLF" 876 "Wallis and Futuna" wallis [[futuna]]]
- ["EH" "ESH" 732 "Western Sahara" western_sahara []]
- ["YE" "YEM" 887 "Yemen" yemen []]
- ["ZM" "ZMB" 894 "Zambia" zambia []]
- ["ZW" "ZWE" 716 "Zimbabwe" zimbabwe []]
- )
-
- (implementation: #export equivalence
- (Equivalence Territory)
-
- (def: (= reference sample)
- (is? reference sample)))
-
- (implementation: #export hash
- (Hash Territory)
-
- (def: &equivalence ..equivalence)
-
- (def: hash
- (|>> :representation
- (get@ #long)
- (\ text.hash hash))))
- )