From 523074289af8d9b473ed89e60fa586498de75aff Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 8 Jul 2022 02:09:34 -0400 Subject: Moved "lux/locale" to "lux/world/locale". --- stdlib/source/documentation/lux.lux | 2 - stdlib/source/documentation/lux/locale.lux | 31 - .../source/documentation/lux/locale/language.lux | 659 --------------------- .../source/documentation/lux/locale/territory.lux | 320 ---------- stdlib/source/documentation/lux/world.lux | 7 +- stdlib/source/documentation/lux/world/locale.lux | 31 + .../documentation/lux/world/locale/language.lux | 659 +++++++++++++++++++++ .../documentation/lux/world/locale/territory.lux | 320 ++++++++++ stdlib/source/library/lux/locale.lux | 47 -- stdlib/source/library/lux/locale/language.lux | 575 ------------------ stdlib/source/library/lux/locale/territory.lux | 314 ---------- stdlib/source/library/lux/meta/macro/class.lux | 55 ++ stdlib/source/library/lux/meta/macro/custom.lux | 53 -- stdlib/source/library/lux/world/locale.lux | 47 ++ .../source/library/lux/world/locale/language.lux | 575 ++++++++++++++++++ .../source/library/lux/world/locale/territory.lux | 314 ++++++++++ stdlib/source/test/lux.lux | 2 - stdlib/source/test/lux/locale.lux | 98 --- stdlib/source/test/lux/locale/language.lux | 301 ---------- stdlib/source/test/lux/locale/territory.lux | 227 ------- stdlib/source/test/lux/world.lux | 4 +- stdlib/source/test/lux/world/locale.lux | 98 +++ stdlib/source/test/lux/world/locale/language.lux | 301 ++++++++++ stdlib/source/test/lux/world/locale/territory.lux | 227 +++++++ 24 files changed, 2635 insertions(+), 2632 deletions(-) delete mode 100644 stdlib/source/documentation/lux/locale.lux delete mode 100644 stdlib/source/documentation/lux/locale/language.lux delete mode 100644 stdlib/source/documentation/lux/locale/territory.lux create mode 100644 stdlib/source/documentation/lux/world/locale.lux create mode 100644 stdlib/source/documentation/lux/world/locale/language.lux create mode 100644 stdlib/source/documentation/lux/world/locale/territory.lux delete mode 100644 stdlib/source/library/lux/locale.lux delete mode 100644 stdlib/source/library/lux/locale/language.lux delete mode 100644 stdlib/source/library/lux/locale/territory.lux create mode 100644 stdlib/source/library/lux/meta/macro/class.lux delete mode 100644 stdlib/source/library/lux/meta/macro/custom.lux create mode 100644 stdlib/source/library/lux/world/locale.lux create mode 100644 stdlib/source/library/lux/world/locale/language.lux create mode 100644 stdlib/source/library/lux/world/locale/territory.lux delete mode 100644 stdlib/source/test/lux/locale.lux delete mode 100644 stdlib/source/test/lux/locale/language.lux delete mode 100644 stdlib/source/test/lux/locale/territory.lux create mode 100644 stdlib/source/test/lux/world/locale.lux create mode 100644 stdlib/source/test/lux/world/locale/language.lux create mode 100644 stdlib/source/test/lux/world/locale/territory.lux (limited to 'stdlib') diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 321aebffd..c76736c72 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -22,7 +22,6 @@ ["[1][0]" documentation] ["[1][0]" extension] ["[1][0]" ffi] - ["[1][0]" locale] ["[1][0]" math] ["[1][0]" meta] ["[1][0]" program] @@ -891,7 +890,6 @@ /documentation.documentation /extension.documentation /ffi.documentation - /locale.documentation /math.documentation /meta.documentation /program.documentation diff --git a/stdlib/source/documentation/lux/locale.lux b/stdlib/source/documentation/lux/locale.lux deleted file mode 100644 index b03601d73..000000000 --- a/stdlib/source/documentation/lux/locale.lux +++ /dev/null @@ -1,31 +0,0 @@ -(.require - [library - [lux (.except char) - ["$" documentation] - [data - [text - ["%" \\format (.only format)]] - [collection - ["[0]" list]]]]] - ["[0]" / - ["[1][0]" language] - ["[1][0]" territory]] - [\\library - ["[0]" /]]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.default /.code) - ($.default /.hash) - ($.default /.equivalence) - - ($.documentation /.Locale - "A description of a locale; with territory, (optional) language, and (optional) text-encoding.") - - ($.documentation /.locale - "" - [(locale language territory encoding)])] - [/language.documentation - /territory.documentation])) diff --git a/stdlib/source/documentation/lux/locale/language.lux b/stdlib/source/documentation/lux/locale/language.lux deleted file mode 100644 index cc0f4e7be..000000000 --- a/stdlib/source/documentation/lux/locale/language.lux +++ /dev/null @@ -1,659 +0,0 @@ -(.require - [library - [lux (.except char) - ["$" documentation] - [data - [text - ["%" \\format (.only format)]] - [collection - ["[0]" list]]]]] - [\\library - ["[0]" /]]) - -(def items/~ - (list.together - (list ($.default /.uncoded) - ($.default /.multiple) - ($.default /.undetermined) - ($.default /.not_applicable)))) - -(def items/a - (list.together - (list ($.default /.afar) - ($.default /.abkhazian) - ($.default /.achinese) - ($.default /.acoli) - ($.default /.adangme) - ($.default /.adyghe) - ($.default /.afro_asiatic) - ($.default /.afrihili) - ($.default /.afrikaans) - ($.default /.ainu) - ($.default /.akan) - ($.default /.akkadian) - ($.default /.aleut) - ($.default /.algonquian) - ($.default /.southern_altai) - ($.default /.amharic) - ($.default /.old_english) - ($.default /.angika) - ($.default /.apache) - ($.default /.arabic) - ($.default /.official_aramaic) - ($.default /.imperial_aramaic) - ($.default /.aragonese) - ($.default /.mapudungun) - ($.default /.arapaho) - ($.default /.artificial) - ($.default /.arawak) - ($.default /.assamese) - ($.default /.asturian) - ($.default /.bable) - ($.default /.leonese) - ($.default /.asturleonese) - ($.default /.athapascan) - ($.default /.australian) - ($.default /.avaric) - ($.default /.avestan) - ($.default /.awadhi) - ($.default /.aymara) - ($.default /.azerbaijani)))) - -(def items/b - (list.together - (list ($.default /.banda) - ($.default /.bamileke) - ($.default /.bashkir) - ($.default /.baluchi) - ($.default /.bambara) - ($.default /.balinese) - ($.default /.basa) - ($.default /.baltic) - ($.default /.beja) - ($.default /.belarusian) - ($.default /.bemba) - ($.default /.bengali) - ($.default /.berber) - ($.default /.bhojpuri) - ($.default /.bihari) - ($.default /.bikol) - ($.default /.bini) - ($.default /.edo) - ($.default /.bislama) - ($.default /.siksika) - ($.default /.bantu) - ($.default /.tibetan) - ($.default /.bosnian) - ($.default /.braj) - ($.default /.breton) - ($.default /.batak) - ($.default /.buriat) - ($.default /.buginese) - ($.default /.bulgarian) - ($.default /.blin) - ($.default /.bilin)))) - -(def items/c - (list.together - (list ($.default /.caddo) - ($.default /.central_american_indian) - ($.default /.galibi_carib) - ($.default /.catalan) - ($.default /.valencian) - ($.default /.caucasian) - ($.default /.cebuano) - ($.default /.celtic) - ($.default /.czech) - ($.default /.chamorro) - ($.default /.chibcha) - ($.default /.chechen) - ($.default /.chagatai) - ($.default /.chuukese) - ($.default /.mari) - ($.default /.chinook) - ($.default /.choctaw) - ($.default /.chipewyan) - ($.default /.cherokee) - ($.default /.church_slavic) - ($.default /.old_slavonic) - ($.default /.church_slavonic) - ($.default /.old_bulgarian) - ($.default /.old_church_slavonic) - ($.default /.chuvash) - ($.default /.cheyenne) - ($.default /.chamic) - ($.default /.montenegrin) - ($.default /.coptic) - ($.default /.cornish) - ($.default /.corsican) - ($.default /.creoles_and_pidgins/english) - ($.default /.creoles_and_pidgins/french) - ($.default /.creoles_and_pidgins/portuguese) - ($.default /.cree) - ($.default /.crimean) - ($.default /.creoles_and_pidgins) - ($.default /.kashubian) - ($.default /.cushitic) - ($.default /.welsh)))) - -(def items/d - (list.together - (list ($.default /.dakota) - ($.default /.danish) - ($.default /.dargwa) - ($.default /.land_dayak) - ($.default /.delaware) - ($.default /.slavey) - ($.default /.german) - ($.default /.dogrib) - ($.default /.dinka) - ($.default /.dhivehi) - ($.default /.maldivian) - ($.default /.dogri) - ($.default /.dravidian) - ($.default /.lower_sorbian) - ($.default /.duala) - ($.default /.middle_dutch) - ($.default /.dyula) - ($.default /.dzongkha)))) - -(def items/e - (list.together - (list ($.default /.efik) - ($.default /.egyptian) - ($.default /.ekajuk) - ($.default /.greek) - ($.default /.elamite) - ($.default /.english) - ($.default /.middle_english) - ($.default /.esperanto) - ($.default /.estonian) - ($.default /.basque) - ($.default /.ewe) - ($.default /.ewondo)))) - -(def items/f - (list.together - (list ($.default /.fang) - ($.default /.faroese) - ($.default /.persian) - ($.default /.fanti) - ($.default /.fijian) - ($.default /.filipino) - ($.default /.finnish) - ($.default /.finno_ugrian) - ($.default /.fon) - ($.default /.french) - ($.default /.middle_french) - ($.default /.old_french) - ($.default /.northern_frisian) - ($.default /.eastern_frisian) - ($.default /.western_frisian) - ($.default /.fulah) - ($.default /.friulian)))) - -(def items/g - (list.together - (list ($.default /.ga) - ($.default /.gayo) - ($.default /.gbaya) - ($.default /.germanic) - ($.default /.geez) - ($.default /.gilbertese) - ($.default /.gaelic) - ($.default /.irish) - ($.default /.galician) - ($.default /.manx) - ($.default /.middle_high_german) - ($.default /.old_high_german) - ($.default /.gondi) - ($.default /.gorontalo) - ($.default /.gothic) - ($.default /.grebo) - ($.default /.ancient_greek) - ($.default /.guarani) - ($.default /.swiss_german) - ($.default /.alemannic) - ($.default /.alsatian) - ($.default /.gujarati) - ($.default /.gwich'in)))) - -(def items/h - (list.together - (list ($.default /.haida) - ($.default /.haitian) - ($.default /.hausa) - ($.default /.hawaiian) - ($.default /.hebrew) - ($.default /.herero) - ($.default /.hiligaynon) - ($.default /.himachali) - ($.default /.hindi) - ($.default /.hittite) - ($.default /.hmong) - ($.default /.hiri_motu) - ($.default /.croatian) - ($.default /.upper_sorbian) - ($.default /.hungarian) - ($.default /.hupa) - ($.default /.armenian)))) - -(def items/i - (list.together - (list ($.default /.iban) - ($.default /.igbo) - ($.default /.ido) - ($.default /.sichuan_yi) - ($.default /.nuosu) - ($.default /.ijo) - ($.default /.inuktitut) - ($.default /.interlingue) - ($.default /.iloko) - ($.default /.interlingua) - ($.default /.indic) - ($.default /.indonesian) - ($.default /.indo_european) - ($.default /.ingush) - ($.default /.inupiaq) - ($.default /.iranian) - ($.default /.iroquoian) - ($.default /.icelandic) - ($.default /.italian)))) - -(def items/j - (list.together - (list ($.default /.javanese) - ($.default /.lojban) - ($.default /.japanese) - ($.default /.judeo_persian) - ($.default /.judeo_arabic)))) - -(def items/k - (list.together - (list ($.default /.kara_kalpak) - ($.default /.kabyle) - ($.default /.kachin) - ($.default /.jingpho) - ($.default /.kalaallisut) - ($.default /.greenlandic) - ($.default /.kamba) - ($.default /.kannada) - ($.default /.karen) - ($.default /.kashmiri) - ($.default /.georgian) - ($.default /.kanuri) - ($.default /.kawi) - ($.default /.kazakh) - ($.default /.kabardian) - ($.default /.khasi) - ($.default /.khoisan) - ($.default /.central_khmer) - ($.default /.khotanese) - ($.default /.sakan) - ($.default /.gikuyu) - ($.default /.kinyarwanda) - ($.default /.kyrgyz) - ($.default /.kimbundu) - ($.default /.konkani) - ($.default /.komi) - ($.default /.kongo) - ($.default /.korean) - ($.default /.kosraean) - ($.default /.kpelle) - ($.default /.karachay_balkar) - ($.default /.karelian) - ($.default /.kru) - ($.default /.kurukh) - ($.default /.kwanyama) - ($.default /.kumyk) - ($.default /.kurdish) - ($.default /.kutenai)))) - -(def items/l - (list.together - (list ($.default /.ladino) - ($.default /.lahnda) - ($.default /.lamba) - ($.default /.lao) - ($.default /.latin) - ($.default /.latvian) - ($.default /.lezghian) - ($.default /.limburgan) - ($.default /.lingala) - ($.default /.lithuanian) - ($.default /.mongo) - ($.default /.lozi) - ($.default /.luxembourgish) - ($.default /.luba_lulua) - ($.default /.luba_katanga) - ($.default /.ganda) - ($.default /.luiseno) - ($.default /.lunda) - ($.default /.luo) - ($.default /.lushai)))) - -(def items/m - (list.together - (list ($.default /.madurese) - ($.default /.magahi) - ($.default /.marshallese) - ($.default /.maithili) - ($.default /.makasar) - ($.default /.malayalam) - ($.default /.mandingo) - ($.default /.austronesian) - ($.default /.marathi) - ($.default /.masai) - ($.default /.moksha) - ($.default /.mandar) - ($.default /.mende) - ($.default /.middle_irish) - ($.default /.mi'kmaq) - ($.default /.micmac) - ($.default /.minangkabau) - ($.default /.macedonian) - ($.default /.mon_khmer) - ($.default /.malagasy) - ($.default /.maltese) - ($.default /.manchu) - ($.default /.manipuri) - ($.default /.manobo) - ($.default /.mohawk) - ($.default /.mongolian) - ($.default /.mossi) - ($.default /.maori) - ($.default /.malay) - ($.default /.munda) - ($.default /.creek) - ($.default /.mirandese) - ($.default /.marwari) - ($.default /.burmese) - ($.default /.mayan) - ($.default /.erzya)))) - -(def items/n - (list.together - (list ($.default /.nahuatl) - ($.default /.north_american_indian) - ($.default /.neapolitan) - ($.default /.nauru) - ($.default /.navajo) - ($.default /.south_ndebele) - ($.default /.north_ndebele) - ($.default /.ndonga) - ($.default /.low_german) - ($.default /.nepali) - ($.default /.newari) - ($.default /.nepal_bhasa) - ($.default /.nias) - ($.default /.niger_kordofanian) - ($.default /.niuean) - ($.default /.dutch) - ($.default /.flemish) - ($.default /.nynorsk) - ($.default /.bokmal) - ($.default /.nogai) - ($.default /.old_norse) - ($.default /.norwegian) - ($.default /.n'ko) - ($.default /.northern_sotho) - ($.default /.pedi) - ($.default /.sepedi) - ($.default /.nubian) - ($.default /.old_newari) - ($.default /.classical_newari) - ($.default /.classical_nepal_bhasa) - ($.default /.nyanja) - ($.default /.chichewa) - ($.default /.chewa) - ($.default /.nyamwezi) - ($.default /.nyankole) - ($.default /.nyoro) - ($.default /.nzima)))) - -(def items/o - (list.together - (list ($.default /.occitan) - ($.default /.provencal) - ($.default /.ojibwa) - ($.default /.oriya) - ($.default /.oromo) - ($.default /.osage) - ($.default /.ossetic) - ($.default /.ottoman_turkish) - ($.default /.otomian)))) - -(def items/p - (list.together - (list ($.default /.papuan) - ($.default /.pangasinan) - ($.default /.pahlavi) - ($.default /.pampanga) - ($.default /.kapampangan) - ($.default /.punjabi) - ($.default /.papiamento) - ($.default /.palauan) - ($.default /.old_persian) - ($.default /.philippine) - ($.default /.phoenician) - ($.default /.pali) - ($.default /.polish) - ($.default /.pohnpeian) - ($.default /.portuguese) - ($.default /.prakrit) - ($.default /.old_provencal) - ($.default /.pashto)))) - -(def items/q - (list.together - (list ($.default /.quechua)))) - -(def items/r - (list.together - (list ($.default /.rajasthani) - ($.default /.rapanui) - ($.default /.rarotongan) - ($.default /.cook_islands_maori) - ($.default /.romance) - ($.default /.romansh) - ($.default /.romany) - ($.default /.romanian) - ($.default /.moldavian) - ($.default /.moldovan) - ($.default /.rundi) - ($.default /.aromanian) - ($.default /.arumanian) - ($.default /.macedo_romanian) - ($.default /.russian)))) - -(def items/s - (list.together - (list ($.default /.sandawe) - ($.default /.sango) - ($.default /.yakut) - ($.default /.south_american_indian) - ($.default /.salishan) - ($.default /.samaritan_aramaic) - ($.default /.sanskrit) - ($.default /.sasak) - ($.default /.santali) - ($.default /.sicilian) - ($.default /.scots) - ($.default /.selkup) - ($.default /.semitic) - ($.default /.old_irish) - ($.default /.sign) - ($.default /.shan) - ($.default /.sidamo) - ($.default /.sinhalese) - ($.default /.siouan) - ($.default /.sino_tibetan) - ($.default /.slavic) - ($.default /.slovak) - ($.default /.slovenian) - ($.default /.southern_sami) - ($.default /.northern_sami) - ($.default /.sami) - ($.default /.lule) - ($.default /.inari) - ($.default /.samoan) - ($.default /.skolt_sami) - ($.default /.shona) - ($.default /.sindhi) - ($.default /.soninke) - ($.default /.sogdian) - ($.default /.somali) - ($.default /.songhai) - ($.default /.southern_sotho) - ($.default /.spanish) - ($.default /.castilian) - ($.default /.albanian) - ($.default /.sardinian) - ($.default /.sranan_tongo) - ($.default /.serbian) - ($.default /.serer) - ($.default /.nilo_saharan) - ($.default /.swati) - ($.default /.sukuma) - ($.default /.sundanese) - ($.default /.susu) - ($.default /.sumerian) - ($.default /.swahili) - ($.default /.swedish) - ($.default /.classical_syriac) - ($.default /.syriac)))) - -(def items/t - (list.together - (list ($.default /.tahitian) - ($.default /.tai) - ($.default /.tamil) - ($.default /.tatar) - ($.default /.telugu) - ($.default /.timne) - ($.default /.tereno) - ($.default /.tetum) - ($.default /.tajik) - ($.default /.tagalog) - ($.default /.thai) - ($.default /.tigre) - ($.default /.tigrinya) - ($.default /.tiv) - ($.default /.tokelau) - ($.default /.klingon) - ($.default /.tlingit) - ($.default /.tamashek) - ($.default /.tonga) - ($.default /.tongan) - ($.default /.tok_pisin) - ($.default /.tsimshian) - ($.default /.tswana) - ($.default /.tsonga) - ($.default /.turkmen) - ($.default /.tumbuka) - ($.default /.tupi) - ($.default /.turkish) - ($.default /.altaic) - ($.default /.tuvalu) - ($.default /.twi) - ($.default /.tuvinian)))) - -(def items/u - (list.together - (list ($.default /.udmurt) - ($.default /.ugaritic) - ($.default /.uyghur) - ($.default /.ukrainian) - ($.default /.umbundu) - ($.default /.urdu) - ($.default /.uzbek)))) - -(def items/v - (list.together - (list ($.default /.vai) - ($.default /.venda) - ($.default /.vietnamese) - ($.default /.volapük) - ($.default /.votic)))) - -(def items/w - (list.together - (list ($.default /.wakashan) - ($.default /.walamo) - ($.default /.waray) - ($.default /.washo) - ($.default /.sorbian) - ($.default /.walloon) - ($.default /.wolof)))) - -(def items/x - (list.together - (list ($.default /.kalmyk) - ($.default /.oirat) - ($.default /.xhosa)))) - -(def items/y - (list.together - (list ($.default /.yao) - ($.default /.yapese) - ($.default /.yiddish) - ($.default /.yoruba) - ($.default /.yupik)))) - -(def items/z - (list.together - (list ($.default /.zapotec) - ($.default /.blissymbols) - ($.default /.zenaga) - ($.default /.standard_moroccan_tamazight) - ($.default /.zhuang) - ($.default /.chinese) - ($.default /.zande) - ($.default /.zulu) - ($.default /.zuni) - ($.default /.zaza) - ($.default /.dimili) - ($.default /.dimli) - ($.default /.kirdki) - ($.default /.kirmanjki) - ($.default /.zazaki)))) - -(.def .public documentation - (.List $.Module) - (`` ($.module /._ - "" - [($.default /.name) - ($.default /.code) - ($.default /.equivalence) - ($.default /.hash) - ..items/~ - ..items/a - ..items/b - ..items/c - ..items/d - ..items/e - ..items/f - ..items/g - ..items/h - ..items/i - ..items/j - ..items/k - ..items/l - ..items/m - ..items/n - ..items/o - ..items/p - ..items/q - ..items/r - ..items/s - ..items/t - ..items/u - ..items/v - ..items/w - ..items/x - ..items/y - ..items/z - - ($.documentation /.Language - "An ISO 639 language.")] - []))) diff --git a/stdlib/source/documentation/lux/locale/territory.lux b/stdlib/source/documentation/lux/locale/territory.lux deleted file mode 100644 index 232f18038..000000000 --- a/stdlib/source/documentation/lux/locale/territory.lux +++ /dev/null @@ -1,320 +0,0 @@ -(.require - [library - [lux (.except char) - ["$" documentation] - [data - [text - ["%" \\format (.only format)]] - [collection - ["[0]" list]]]]] - [\\library - ["[0]" /]]) - -(def items/ab - (list.together - (list ($.default /.afghanistan) - ($.default /.aland_islands) - ($.default /.albania) - ($.default /.algeria) - ($.default /.american_samoa) - ($.default /.andorra) - ($.default /.angola) - ($.default /.anguilla) - ($.default /.antarctica) - ($.default /.antigua) - ($.default /.barbuda) - ($.default /.argentina) - ($.default /.armenia) - ($.default /.aruba) - ($.default /.australia) - ($.default /.austria) - ($.default /.azerbaijan) - ($.default /.the_bahamas) - ($.default /.bahrain) - ($.default /.bangladesh) - ($.default /.barbados) - ($.default /.belarus) - ($.default /.belgium) - ($.default /.belize) - ($.default /.benin) - ($.default /.bermuda) - ($.default /.bhutan) - ($.default /.bolivia) - ($.default /.bonaire) - ($.default /.sint_eustatius) - ($.default /.saba) - ($.default /.bosnia) - ($.default /.herzegovina) - ($.default /.botswana) - ($.default /.bouvet_island) - ($.default /.brazil) - ($.default /.british_indian_ocean_territory) - ($.default /.brunei_darussalam) - ($.default /.bulgaria) - ($.default /.burkina_faso) - ($.default /.burundi)))) - -(def items/cd - (list.together - (list ($.default /.cape_verde) - ($.default /.cambodia) - ($.default /.cameroon) - ($.default /.canada) - ($.default /.cayman_islands) - ($.default /.central_african_republic) - ($.default /.chad) - ($.default /.chile) - ($.default /.china) - ($.default /.christmas_island) - ($.default /.cocos_islands) - ($.default /.colombia) - ($.default /.comoros) - ($.default /.congo) - ($.default /.democratic_republic_of_the_congo) - ($.default /.cook_islands) - ($.default /.costa_rica) - ($.default /.ivory_coast) - ($.default /.croatia) - ($.default /.cuba) - ($.default /.curacao) - ($.default /.cyprus) - ($.default /.czech_republic) - ($.default /.denmark) - ($.default /.djibouti) - ($.default /.dominica) - ($.default /.dominican_republic)))) - -(def items/efg - (list.together - (list ($.default /.ecuador) - ($.default /.egypt) - ($.default /.el_salvador) - ($.default /.equatorial_guinea) - ($.default /.eritrea) - ($.default /.estonia) - ($.default /.eswatini) - ($.default /.ethiopia) - ($.default /.falkland_islands) - ($.default /.faroe_islands) - ($.default /.fiji) - ($.default /.finland) - ($.default /.france) - ($.default /.french_guiana) - ($.default /.french_polynesia) - ($.default /.french_southern_territories) - ($.default /.gabon) - ($.default /.the_gambia) - ($.default /.georgia) - ($.default /.germany) - ($.default /.ghana) - ($.default /.gibraltar) - ($.default /.greece) - ($.default /.greenland) - ($.default /.grenada) - ($.default /.guadeloupe) - ($.default /.guam) - ($.default /.guatemala) - ($.default /.guernsey) - ($.default /.guinea) - ($.default /.guinea_bissau) - ($.default /.guyana)))) - -(def items/hijkl - (list.together - (list ($.default /.haiti) - ($.default /.heard_island) - ($.default /.mcdonald_islands) - ($.default /.vatican_city) - ($.default /.honduras) - ($.default /.hong_kong) - ($.default /.hungary) - ($.default /.iceland) - ($.default /.india) - ($.default /.indonesia) - ($.default /.iran) - ($.default /.iraq) - ($.default /.ireland) - ($.default /.isle_of_man) - ($.default /.israel) - ($.default /.italy) - ($.default /.jamaica) - ($.default /.japan) - ($.default /.jersey) - ($.default /.jordan) - ($.default /.kazakhstan) - ($.default /.kenya) - ($.default /.kiribati) - ($.default /.north_korea) - ($.default /.south_korea) - ($.default /.kuwait) - ($.default /.kyrgyzstan) - ($.default /.laos) - ($.default /.latvia) - ($.default /.lebanon) - ($.default /.lesotho) - ($.default /.liberia) - ($.default /.libya) - ($.default /.liechtenstein) - ($.default /.lithuania) - ($.default /.luxembourg)))) - -(def items/mno - (list.together - (list ($.default /.macau) - ($.default /.macedonia) - ($.default /.madagascar) - ($.default /.malawi) - ($.default /.malaysia) - ($.default /.maldives) - ($.default /.mali) - ($.default /.malta) - ($.default /.marshall_islands) - ($.default /.martinique) - ($.default /.mauritania) - ($.default /.mauritius) - ($.default /.mayotte) - ($.default /.mexico) - ($.default /.micronesia) - ($.default /.moldova) - ($.default /.monaco) - ($.default /.mongolia) - ($.default /.montenegro) - ($.default /.montserrat) - ($.default /.morocco) - ($.default /.mozambique) - ($.default /.myanmar) - ($.default /.namibia) - ($.default /.nauru) - ($.default /.nepal) - ($.default /.netherlands) - ($.default /.new_caledonia) - ($.default /.new_zealand) - ($.default /.nicaragua) - ($.default /.niger) - ($.default /.nigeria) - ($.default /.niue) - ($.default /.norfolk_island) - ($.default /.northern_mariana_islands) - ($.default /.norway) - ($.default /.oman)))) - -(def items/pqrs - (list.together - (list ($.default /.pakistan) - ($.default /.palau) - ($.default /.palestine) - ($.default /.panama) - ($.default /.papua_new_guinea) - ($.default /.paraguay) - ($.default /.peru) - ($.default /.philippines) - ($.default /.pitcairn_islands) - ($.default /.poland) - ($.default /.portugal) - ($.default /.puerto_rico) - ($.default /.qatar) - ($.default /.reunion) - ($.default /.romania) - ($.default /.russia) - ($.default /.rwanda) - ($.default /.saint_barthelemy) - ($.default /.saint_helena) - ($.default /.ascension) - ($.default /.tristan_da_cunha) - ($.default /.saint_kitts) - ($.default /.nevis) - ($.default /.saint_lucia) - ($.default /.saint_martin) - ($.default /.saint_pierre) - ($.default /.miquelon) - ($.default /.saint_vincent) - ($.default /.the_grenadines) - ($.default /.samoa) - ($.default /.san_marino) - ($.default /.sao_tome) - ($.default /.principe) - ($.default /.saudi_arabia) - ($.default /.senegal) - ($.default /.serbia) - ($.default /.seychelles) - ($.default /.sierra_leone) - ($.default /.singapore) - ($.default /.sint_maarten) - ($.default /.slovakia) - ($.default /.slovenia) - ($.default /.solomon_islands) - ($.default /.somalia) - ($.default /.south_africa) - ($.default /.south_georgia) - ($.default /.south_sandwich_islands) - ($.default /.south_sudan) - ($.default /.spain) - ($.default /.sri_lanka) - ($.default /.sudan) - ($.default /.suriname) - ($.default /.svalbard) - ($.default /.jan_mayen) - ($.default /.sweden) - ($.default /.switzerland) - ($.default /.syria)))) - -(def items/tuvwxyz - (list.together - (list ($.default /.taiwan) - ($.default /.tajikistan) - ($.default /.tanzania) - ($.default /.thailand) - ($.default /.east_timor) - ($.default /.togo) - ($.default /.tokelau) - ($.default /.tonga) - ($.default /.trinidad) - ($.default /.tobago) - ($.default /.tunisia) - ($.default /.turkey) - ($.default /.turkmenistan) - ($.default /.turks) - ($.default /.caicos_islands) - ($.default /.tuvalu) - ($.default /.uganda) - ($.default /.ukraine) - ($.default /.united_arab_emirates) - ($.default /.united_kingdom) - ($.default /.northern_ireland) - ($.default /.united_states_of_america) - ($.default /.united_states_minor_outlying_islands) - ($.default /.uruguay) - ($.default /.uzbekistan) - ($.default /.vanuatu) - ($.default /.venezuela) - ($.default /.vietnam) - ($.default /.british_virgin_islands) - ($.default /.united_states_virgin_islands) - ($.default /.wallis) - ($.default /.futuna) - ($.default /.western_sahara) - ($.default /.yemen) - ($.default /.zambia) - ($.default /.zimbabwe)))) - -(.def .public documentation - (.List $.Module) - (`` ($.module /._ - "" - [($.default /.name) - ($.default /.short_code) - ($.default /.long_code) - ($.default /.numeric_code) - ($.default /.equivalence) - ($.default /.hash) - ..items/ab - ..items/cd - ..items/efg - ..items/hijkl - ..items/mno - ..items/pqrs - ..items/tuvwxyz - - ($.documentation /.Territory - "An ISO 3166 territory.")] - []))) diff --git a/stdlib/source/documentation/lux/world.lux b/stdlib/source/documentation/lux/world.lux index 777b02678..795612a5e 100644 --- a/stdlib/source/documentation/lux/world.lux +++ b/stdlib/source/documentation/lux/world.lux @@ -20,7 +20,8 @@ ["[1]/[0]" resolution]]] ["[1][0]" environment] ["[1][0]" shell] - ["[1][0]" time]]) + ["[1][0]" time] + ["[1][0]" locale]]) (.def .public documentation (.List $.Module) @@ -32,4 +33,6 @@ /output/video/resolution.documentation /environment.documentation /shell.documentation - /time.documentation)) + /time.documentation + /locale.documentation + )) diff --git a/stdlib/source/documentation/lux/world/locale.lux b/stdlib/source/documentation/lux/world/locale.lux new file mode 100644 index 000000000..b03601d73 --- /dev/null +++ b/stdlib/source/documentation/lux/world/locale.lux @@ -0,0 +1,31 @@ +(.require + [library + [lux (.except char) + ["$" documentation] + [data + [text + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] + ["[0]" / + ["[1][0]" language] + ["[1][0]" territory]] + [\\library + ["[0]" /]]) + +(.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.code) + ($.default /.hash) + ($.default /.equivalence) + + ($.documentation /.Locale + "A description of a locale; with territory, (optional) language, and (optional) text-encoding.") + + ($.documentation /.locale + "" + [(locale language territory encoding)])] + [/language.documentation + /territory.documentation])) diff --git a/stdlib/source/documentation/lux/world/locale/language.lux b/stdlib/source/documentation/lux/world/locale/language.lux new file mode 100644 index 000000000..cc0f4e7be --- /dev/null +++ b/stdlib/source/documentation/lux/world/locale/language.lux @@ -0,0 +1,659 @@ +(.require + [library + [lux (.except char) + ["$" documentation] + [data + [text + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] + [\\library + ["[0]" /]]) + +(def items/~ + (list.together + (list ($.default /.uncoded) + ($.default /.multiple) + ($.default /.undetermined) + ($.default /.not_applicable)))) + +(def items/a + (list.together + (list ($.default /.afar) + ($.default /.abkhazian) + ($.default /.achinese) + ($.default /.acoli) + ($.default /.adangme) + ($.default /.adyghe) + ($.default /.afro_asiatic) + ($.default /.afrihili) + ($.default /.afrikaans) + ($.default /.ainu) + ($.default /.akan) + ($.default /.akkadian) + ($.default /.aleut) + ($.default /.algonquian) + ($.default /.southern_altai) + ($.default /.amharic) + ($.default /.old_english) + ($.default /.angika) + ($.default /.apache) + ($.default /.arabic) + ($.default /.official_aramaic) + ($.default /.imperial_aramaic) + ($.default /.aragonese) + ($.default /.mapudungun) + ($.default /.arapaho) + ($.default /.artificial) + ($.default /.arawak) + ($.default /.assamese) + ($.default /.asturian) + ($.default /.bable) + ($.default /.leonese) + ($.default /.asturleonese) + ($.default /.athapascan) + ($.default /.australian) + ($.default /.avaric) + ($.default /.avestan) + ($.default /.awadhi) + ($.default /.aymara) + ($.default /.azerbaijani)))) + +(def items/b + (list.together + (list ($.default /.banda) + ($.default /.bamileke) + ($.default /.bashkir) + ($.default /.baluchi) + ($.default /.bambara) + ($.default /.balinese) + ($.default /.basa) + ($.default /.baltic) + ($.default /.beja) + ($.default /.belarusian) + ($.default /.bemba) + ($.default /.bengali) + ($.default /.berber) + ($.default /.bhojpuri) + ($.default /.bihari) + ($.default /.bikol) + ($.default /.bini) + ($.default /.edo) + ($.default /.bislama) + ($.default /.siksika) + ($.default /.bantu) + ($.default /.tibetan) + ($.default /.bosnian) + ($.default /.braj) + ($.default /.breton) + ($.default /.batak) + ($.default /.buriat) + ($.default /.buginese) + ($.default /.bulgarian) + ($.default /.blin) + ($.default /.bilin)))) + +(def items/c + (list.together + (list ($.default /.caddo) + ($.default /.central_american_indian) + ($.default /.galibi_carib) + ($.default /.catalan) + ($.default /.valencian) + ($.default /.caucasian) + ($.default /.cebuano) + ($.default /.celtic) + ($.default /.czech) + ($.default /.chamorro) + ($.default /.chibcha) + ($.default /.chechen) + ($.default /.chagatai) + ($.default /.chuukese) + ($.default /.mari) + ($.default /.chinook) + ($.default /.choctaw) + ($.default /.chipewyan) + ($.default /.cherokee) + ($.default /.church_slavic) + ($.default /.old_slavonic) + ($.default /.church_slavonic) + ($.default /.old_bulgarian) + ($.default /.old_church_slavonic) + ($.default /.chuvash) + ($.default /.cheyenne) + ($.default /.chamic) + ($.default /.montenegrin) + ($.default /.coptic) + ($.default /.cornish) + ($.default /.corsican) + ($.default /.creoles_and_pidgins/english) + ($.default /.creoles_and_pidgins/french) + ($.default /.creoles_and_pidgins/portuguese) + ($.default /.cree) + ($.default /.crimean) + ($.default /.creoles_and_pidgins) + ($.default /.kashubian) + ($.default /.cushitic) + ($.default /.welsh)))) + +(def items/d + (list.together + (list ($.default /.dakota) + ($.default /.danish) + ($.default /.dargwa) + ($.default /.land_dayak) + ($.default /.delaware) + ($.default /.slavey) + ($.default /.german) + ($.default /.dogrib) + ($.default /.dinka) + ($.default /.dhivehi) + ($.default /.maldivian) + ($.default /.dogri) + ($.default /.dravidian) + ($.default /.lower_sorbian) + ($.default /.duala) + ($.default /.middle_dutch) + ($.default /.dyula) + ($.default /.dzongkha)))) + +(def items/e + (list.together + (list ($.default /.efik) + ($.default /.egyptian) + ($.default /.ekajuk) + ($.default /.greek) + ($.default /.elamite) + ($.default /.english) + ($.default /.middle_english) + ($.default /.esperanto) + ($.default /.estonian) + ($.default /.basque) + ($.default /.ewe) + ($.default /.ewondo)))) + +(def items/f + (list.together + (list ($.default /.fang) + ($.default /.faroese) + ($.default /.persian) + ($.default /.fanti) + ($.default /.fijian) + ($.default /.filipino) + ($.default /.finnish) + ($.default /.finno_ugrian) + ($.default /.fon) + ($.default /.french) + ($.default /.middle_french) + ($.default /.old_french) + ($.default /.northern_frisian) + ($.default /.eastern_frisian) + ($.default /.western_frisian) + ($.default /.fulah) + ($.default /.friulian)))) + +(def items/g + (list.together + (list ($.default /.ga) + ($.default /.gayo) + ($.default /.gbaya) + ($.default /.germanic) + ($.default /.geez) + ($.default /.gilbertese) + ($.default /.gaelic) + ($.default /.irish) + ($.default /.galician) + ($.default /.manx) + ($.default /.middle_high_german) + ($.default /.old_high_german) + ($.default /.gondi) + ($.default /.gorontalo) + ($.default /.gothic) + ($.default /.grebo) + ($.default /.ancient_greek) + ($.default /.guarani) + ($.default /.swiss_german) + ($.default /.alemannic) + ($.default /.alsatian) + ($.default /.gujarati) + ($.default /.gwich'in)))) + +(def items/h + (list.together + (list ($.default /.haida) + ($.default /.haitian) + ($.default /.hausa) + ($.default /.hawaiian) + ($.default /.hebrew) + ($.default /.herero) + ($.default /.hiligaynon) + ($.default /.himachali) + ($.default /.hindi) + ($.default /.hittite) + ($.default /.hmong) + ($.default /.hiri_motu) + ($.default /.croatian) + ($.default /.upper_sorbian) + ($.default /.hungarian) + ($.default /.hupa) + ($.default /.armenian)))) + +(def items/i + (list.together + (list ($.default /.iban) + ($.default /.igbo) + ($.default /.ido) + ($.default /.sichuan_yi) + ($.default /.nuosu) + ($.default /.ijo) + ($.default /.inuktitut) + ($.default /.interlingue) + ($.default /.iloko) + ($.default /.interlingua) + ($.default /.indic) + ($.default /.indonesian) + ($.default /.indo_european) + ($.default /.ingush) + ($.default /.inupiaq) + ($.default /.iranian) + ($.default /.iroquoian) + ($.default /.icelandic) + ($.default /.italian)))) + +(def items/j + (list.together + (list ($.default /.javanese) + ($.default /.lojban) + ($.default /.japanese) + ($.default /.judeo_persian) + ($.default /.judeo_arabic)))) + +(def items/k + (list.together + (list ($.default /.kara_kalpak) + ($.default /.kabyle) + ($.default /.kachin) + ($.default /.jingpho) + ($.default /.kalaallisut) + ($.default /.greenlandic) + ($.default /.kamba) + ($.default /.kannada) + ($.default /.karen) + ($.default /.kashmiri) + ($.default /.georgian) + ($.default /.kanuri) + ($.default /.kawi) + ($.default /.kazakh) + ($.default /.kabardian) + ($.default /.khasi) + ($.default /.khoisan) + ($.default /.central_khmer) + ($.default /.khotanese) + ($.default /.sakan) + ($.default /.gikuyu) + ($.default /.kinyarwanda) + ($.default /.kyrgyz) + ($.default /.kimbundu) + ($.default /.konkani) + ($.default /.komi) + ($.default /.kongo) + ($.default /.korean) + ($.default /.kosraean) + ($.default /.kpelle) + ($.default /.karachay_balkar) + ($.default /.karelian) + ($.default /.kru) + ($.default /.kurukh) + ($.default /.kwanyama) + ($.default /.kumyk) + ($.default /.kurdish) + ($.default /.kutenai)))) + +(def items/l + (list.together + (list ($.default /.ladino) + ($.default /.lahnda) + ($.default /.lamba) + ($.default /.lao) + ($.default /.latin) + ($.default /.latvian) + ($.default /.lezghian) + ($.default /.limburgan) + ($.default /.lingala) + ($.default /.lithuanian) + ($.default /.mongo) + ($.default /.lozi) + ($.default /.luxembourgish) + ($.default /.luba_lulua) + ($.default /.luba_katanga) + ($.default /.ganda) + ($.default /.luiseno) + ($.default /.lunda) + ($.default /.luo) + ($.default /.lushai)))) + +(def items/m + (list.together + (list ($.default /.madurese) + ($.default /.magahi) + ($.default /.marshallese) + ($.default /.maithili) + ($.default /.makasar) + ($.default /.malayalam) + ($.default /.mandingo) + ($.default /.austronesian) + ($.default /.marathi) + ($.default /.masai) + ($.default /.moksha) + ($.default /.mandar) + ($.default /.mende) + ($.default /.middle_irish) + ($.default /.mi'kmaq) + ($.default /.micmac) + ($.default /.minangkabau) + ($.default /.macedonian) + ($.default /.mon_khmer) + ($.default /.malagasy) + ($.default /.maltese) + ($.default /.manchu) + ($.default /.manipuri) + ($.default /.manobo) + ($.default /.mohawk) + ($.default /.mongolian) + ($.default /.mossi) + ($.default /.maori) + ($.default /.malay) + ($.default /.munda) + ($.default /.creek) + ($.default /.mirandese) + ($.default /.marwari) + ($.default /.burmese) + ($.default /.mayan) + ($.default /.erzya)))) + +(def items/n + (list.together + (list ($.default /.nahuatl) + ($.default /.north_american_indian) + ($.default /.neapolitan) + ($.default /.nauru) + ($.default /.navajo) + ($.default /.south_ndebele) + ($.default /.north_ndebele) + ($.default /.ndonga) + ($.default /.low_german) + ($.default /.nepali) + ($.default /.newari) + ($.default /.nepal_bhasa) + ($.default /.nias) + ($.default /.niger_kordofanian) + ($.default /.niuean) + ($.default /.dutch) + ($.default /.flemish) + ($.default /.nynorsk) + ($.default /.bokmal) + ($.default /.nogai) + ($.default /.old_norse) + ($.default /.norwegian) + ($.default /.n'ko) + ($.default /.northern_sotho) + ($.default /.pedi) + ($.default /.sepedi) + ($.default /.nubian) + ($.default /.old_newari) + ($.default /.classical_newari) + ($.default /.classical_nepal_bhasa) + ($.default /.nyanja) + ($.default /.chichewa) + ($.default /.chewa) + ($.default /.nyamwezi) + ($.default /.nyankole) + ($.default /.nyoro) + ($.default /.nzima)))) + +(def items/o + (list.together + (list ($.default /.occitan) + ($.default /.provencal) + ($.default /.ojibwa) + ($.default /.oriya) + ($.default /.oromo) + ($.default /.osage) + ($.default /.ossetic) + ($.default /.ottoman_turkish) + ($.default /.otomian)))) + +(def items/p + (list.together + (list ($.default /.papuan) + ($.default /.pangasinan) + ($.default /.pahlavi) + ($.default /.pampanga) + ($.default /.kapampangan) + ($.default /.punjabi) + ($.default /.papiamento) + ($.default /.palauan) + ($.default /.old_persian) + ($.default /.philippine) + ($.default /.phoenician) + ($.default /.pali) + ($.default /.polish) + ($.default /.pohnpeian) + ($.default /.portuguese) + ($.default /.prakrit) + ($.default /.old_provencal) + ($.default /.pashto)))) + +(def items/q + (list.together + (list ($.default /.quechua)))) + +(def items/r + (list.together + (list ($.default /.rajasthani) + ($.default /.rapanui) + ($.default /.rarotongan) + ($.default /.cook_islands_maori) + ($.default /.romance) + ($.default /.romansh) + ($.default /.romany) + ($.default /.romanian) + ($.default /.moldavian) + ($.default /.moldovan) + ($.default /.rundi) + ($.default /.aromanian) + ($.default /.arumanian) + ($.default /.macedo_romanian) + ($.default /.russian)))) + +(def items/s + (list.together + (list ($.default /.sandawe) + ($.default /.sango) + ($.default /.yakut) + ($.default /.south_american_indian) + ($.default /.salishan) + ($.default /.samaritan_aramaic) + ($.default /.sanskrit) + ($.default /.sasak) + ($.default /.santali) + ($.default /.sicilian) + ($.default /.scots) + ($.default /.selkup) + ($.default /.semitic) + ($.default /.old_irish) + ($.default /.sign) + ($.default /.shan) + ($.default /.sidamo) + ($.default /.sinhalese) + ($.default /.siouan) + ($.default /.sino_tibetan) + ($.default /.slavic) + ($.default /.slovak) + ($.default /.slovenian) + ($.default /.southern_sami) + ($.default /.northern_sami) + ($.default /.sami) + ($.default /.lule) + ($.default /.inari) + ($.default /.samoan) + ($.default /.skolt_sami) + ($.default /.shona) + ($.default /.sindhi) + ($.default /.soninke) + ($.default /.sogdian) + ($.default /.somali) + ($.default /.songhai) + ($.default /.southern_sotho) + ($.default /.spanish) + ($.default /.castilian) + ($.default /.albanian) + ($.default /.sardinian) + ($.default /.sranan_tongo) + ($.default /.serbian) + ($.default /.serer) + ($.default /.nilo_saharan) + ($.default /.swati) + ($.default /.sukuma) + ($.default /.sundanese) + ($.default /.susu) + ($.default /.sumerian) + ($.default /.swahili) + ($.default /.swedish) + ($.default /.classical_syriac) + ($.default /.syriac)))) + +(def items/t + (list.together + (list ($.default /.tahitian) + ($.default /.tai) + ($.default /.tamil) + ($.default /.tatar) + ($.default /.telugu) + ($.default /.timne) + ($.default /.tereno) + ($.default /.tetum) + ($.default /.tajik) + ($.default /.tagalog) + ($.default /.thai) + ($.default /.tigre) + ($.default /.tigrinya) + ($.default /.tiv) + ($.default /.tokelau) + ($.default /.klingon) + ($.default /.tlingit) + ($.default /.tamashek) + ($.default /.tonga) + ($.default /.tongan) + ($.default /.tok_pisin) + ($.default /.tsimshian) + ($.default /.tswana) + ($.default /.tsonga) + ($.default /.turkmen) + ($.default /.tumbuka) + ($.default /.tupi) + ($.default /.turkish) + ($.default /.altaic) + ($.default /.tuvalu) + ($.default /.twi) + ($.default /.tuvinian)))) + +(def items/u + (list.together + (list ($.default /.udmurt) + ($.default /.ugaritic) + ($.default /.uyghur) + ($.default /.ukrainian) + ($.default /.umbundu) + ($.default /.urdu) + ($.default /.uzbek)))) + +(def items/v + (list.together + (list ($.default /.vai) + ($.default /.venda) + ($.default /.vietnamese) + ($.default /.volapük) + ($.default /.votic)))) + +(def items/w + (list.together + (list ($.default /.wakashan) + ($.default /.walamo) + ($.default /.waray) + ($.default /.washo) + ($.default /.sorbian) + ($.default /.walloon) + ($.default /.wolof)))) + +(def items/x + (list.together + (list ($.default /.kalmyk) + ($.default /.oirat) + ($.default /.xhosa)))) + +(def items/y + (list.together + (list ($.default /.yao) + ($.default /.yapese) + ($.default /.yiddish) + ($.default /.yoruba) + ($.default /.yupik)))) + +(def items/z + (list.together + (list ($.default /.zapotec) + ($.default /.blissymbols) + ($.default /.zenaga) + ($.default /.standard_moroccan_tamazight) + ($.default /.zhuang) + ($.default /.chinese) + ($.default /.zande) + ($.default /.zulu) + ($.default /.zuni) + ($.default /.zaza) + ($.default /.dimili) + ($.default /.dimli) + ($.default /.kirdki) + ($.default /.kirmanjki) + ($.default /.zazaki)))) + +(.def .public documentation + (.List $.Module) + (`` ($.module /._ + "" + [($.default /.name) + ($.default /.code) + ($.default /.equivalence) + ($.default /.hash) + ..items/~ + ..items/a + ..items/b + ..items/c + ..items/d + ..items/e + ..items/f + ..items/g + ..items/h + ..items/i + ..items/j + ..items/k + ..items/l + ..items/m + ..items/n + ..items/o + ..items/p + ..items/q + ..items/r + ..items/s + ..items/t + ..items/u + ..items/v + ..items/w + ..items/x + ..items/y + ..items/z + + ($.documentation /.Language + "An ISO 639 language.")] + []))) diff --git a/stdlib/source/documentation/lux/world/locale/territory.lux b/stdlib/source/documentation/lux/world/locale/territory.lux new file mode 100644 index 000000000..232f18038 --- /dev/null +++ b/stdlib/source/documentation/lux/world/locale/territory.lux @@ -0,0 +1,320 @@ +(.require + [library + [lux (.except char) + ["$" documentation] + [data + [text + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] + [\\library + ["[0]" /]]) + +(def items/ab + (list.together + (list ($.default /.afghanistan) + ($.default /.aland_islands) + ($.default /.albania) + ($.default /.algeria) + ($.default /.american_samoa) + ($.default /.andorra) + ($.default /.angola) + ($.default /.anguilla) + ($.default /.antarctica) + ($.default /.antigua) + ($.default /.barbuda) + ($.default /.argentina) + ($.default /.armenia) + ($.default /.aruba) + ($.default /.australia) + ($.default /.austria) + ($.default /.azerbaijan) + ($.default /.the_bahamas) + ($.default /.bahrain) + ($.default /.bangladesh) + ($.default /.barbados) + ($.default /.belarus) + ($.default /.belgium) + ($.default /.belize) + ($.default /.benin) + ($.default /.bermuda) + ($.default /.bhutan) + ($.default /.bolivia) + ($.default /.bonaire) + ($.default /.sint_eustatius) + ($.default /.saba) + ($.default /.bosnia) + ($.default /.herzegovina) + ($.default /.botswana) + ($.default /.bouvet_island) + ($.default /.brazil) + ($.default /.british_indian_ocean_territory) + ($.default /.brunei_darussalam) + ($.default /.bulgaria) + ($.default /.burkina_faso) + ($.default /.burundi)))) + +(def items/cd + (list.together + (list ($.default /.cape_verde) + ($.default /.cambodia) + ($.default /.cameroon) + ($.default /.canada) + ($.default /.cayman_islands) + ($.default /.central_african_republic) + ($.default /.chad) + ($.default /.chile) + ($.default /.china) + ($.default /.christmas_island) + ($.default /.cocos_islands) + ($.default /.colombia) + ($.default /.comoros) + ($.default /.congo) + ($.default /.democratic_republic_of_the_congo) + ($.default /.cook_islands) + ($.default /.costa_rica) + ($.default /.ivory_coast) + ($.default /.croatia) + ($.default /.cuba) + ($.default /.curacao) + ($.default /.cyprus) + ($.default /.czech_republic) + ($.default /.denmark) + ($.default /.djibouti) + ($.default /.dominica) + ($.default /.dominican_republic)))) + +(def items/efg + (list.together + (list ($.default /.ecuador) + ($.default /.egypt) + ($.default /.el_salvador) + ($.default /.equatorial_guinea) + ($.default /.eritrea) + ($.default /.estonia) + ($.default /.eswatini) + ($.default /.ethiopia) + ($.default /.falkland_islands) + ($.default /.faroe_islands) + ($.default /.fiji) + ($.default /.finland) + ($.default /.france) + ($.default /.french_guiana) + ($.default /.french_polynesia) + ($.default /.french_southern_territories) + ($.default /.gabon) + ($.default /.the_gambia) + ($.default /.georgia) + ($.default /.germany) + ($.default /.ghana) + ($.default /.gibraltar) + ($.default /.greece) + ($.default /.greenland) + ($.default /.grenada) + ($.default /.guadeloupe) + ($.default /.guam) + ($.default /.guatemala) + ($.default /.guernsey) + ($.default /.guinea) + ($.default /.guinea_bissau) + ($.default /.guyana)))) + +(def items/hijkl + (list.together + (list ($.default /.haiti) + ($.default /.heard_island) + ($.default /.mcdonald_islands) + ($.default /.vatican_city) + ($.default /.honduras) + ($.default /.hong_kong) + ($.default /.hungary) + ($.default /.iceland) + ($.default /.india) + ($.default /.indonesia) + ($.default /.iran) + ($.default /.iraq) + ($.default /.ireland) + ($.default /.isle_of_man) + ($.default /.israel) + ($.default /.italy) + ($.default /.jamaica) + ($.default /.japan) + ($.default /.jersey) + ($.default /.jordan) + ($.default /.kazakhstan) + ($.default /.kenya) + ($.default /.kiribati) + ($.default /.north_korea) + ($.default /.south_korea) + ($.default /.kuwait) + ($.default /.kyrgyzstan) + ($.default /.laos) + ($.default /.latvia) + ($.default /.lebanon) + ($.default /.lesotho) + ($.default /.liberia) + ($.default /.libya) + ($.default /.liechtenstein) + ($.default /.lithuania) + ($.default /.luxembourg)))) + +(def items/mno + (list.together + (list ($.default /.macau) + ($.default /.macedonia) + ($.default /.madagascar) + ($.default /.malawi) + ($.default /.malaysia) + ($.default /.maldives) + ($.default /.mali) + ($.default /.malta) + ($.default /.marshall_islands) + ($.default /.martinique) + ($.default /.mauritania) + ($.default /.mauritius) + ($.default /.mayotte) + ($.default /.mexico) + ($.default /.micronesia) + ($.default /.moldova) + ($.default /.monaco) + ($.default /.mongolia) + ($.default /.montenegro) + ($.default /.montserrat) + ($.default /.morocco) + ($.default /.mozambique) + ($.default /.myanmar) + ($.default /.namibia) + ($.default /.nauru) + ($.default /.nepal) + ($.default /.netherlands) + ($.default /.new_caledonia) + ($.default /.new_zealand) + ($.default /.nicaragua) + ($.default /.niger) + ($.default /.nigeria) + ($.default /.niue) + ($.default /.norfolk_island) + ($.default /.northern_mariana_islands) + ($.default /.norway) + ($.default /.oman)))) + +(def items/pqrs + (list.together + (list ($.default /.pakistan) + ($.default /.palau) + ($.default /.palestine) + ($.default /.panama) + ($.default /.papua_new_guinea) + ($.default /.paraguay) + ($.default /.peru) + ($.default /.philippines) + ($.default /.pitcairn_islands) + ($.default /.poland) + ($.default /.portugal) + ($.default /.puerto_rico) + ($.default /.qatar) + ($.default /.reunion) + ($.default /.romania) + ($.default /.russia) + ($.default /.rwanda) + ($.default /.saint_barthelemy) + ($.default /.saint_helena) + ($.default /.ascension) + ($.default /.tristan_da_cunha) + ($.default /.saint_kitts) + ($.default /.nevis) + ($.default /.saint_lucia) + ($.default /.saint_martin) + ($.default /.saint_pierre) + ($.default /.miquelon) + ($.default /.saint_vincent) + ($.default /.the_grenadines) + ($.default /.samoa) + ($.default /.san_marino) + ($.default /.sao_tome) + ($.default /.principe) + ($.default /.saudi_arabia) + ($.default /.senegal) + ($.default /.serbia) + ($.default /.seychelles) + ($.default /.sierra_leone) + ($.default /.singapore) + ($.default /.sint_maarten) + ($.default /.slovakia) + ($.default /.slovenia) + ($.default /.solomon_islands) + ($.default /.somalia) + ($.default /.south_africa) + ($.default /.south_georgia) + ($.default /.south_sandwich_islands) + ($.default /.south_sudan) + ($.default /.spain) + ($.default /.sri_lanka) + ($.default /.sudan) + ($.default /.suriname) + ($.default /.svalbard) + ($.default /.jan_mayen) + ($.default /.sweden) + ($.default /.switzerland) + ($.default /.syria)))) + +(def items/tuvwxyz + (list.together + (list ($.default /.taiwan) + ($.default /.tajikistan) + ($.default /.tanzania) + ($.default /.thailand) + ($.default /.east_timor) + ($.default /.togo) + ($.default /.tokelau) + ($.default /.tonga) + ($.default /.trinidad) + ($.default /.tobago) + ($.default /.tunisia) + ($.default /.turkey) + ($.default /.turkmenistan) + ($.default /.turks) + ($.default /.caicos_islands) + ($.default /.tuvalu) + ($.default /.uganda) + ($.default /.ukraine) + ($.default /.united_arab_emirates) + ($.default /.united_kingdom) + ($.default /.northern_ireland) + ($.default /.united_states_of_america) + ($.default /.united_states_minor_outlying_islands) + ($.default /.uruguay) + ($.default /.uzbekistan) + ($.default /.vanuatu) + ($.default /.venezuela) + ($.default /.vietnam) + ($.default /.british_virgin_islands) + ($.default /.united_states_virgin_islands) + ($.default /.wallis) + ($.default /.futuna) + ($.default /.western_sahara) + ($.default /.yemen) + ($.default /.zambia) + ($.default /.zimbabwe)))) + +(.def .public documentation + (.List $.Module) + (`` ($.module /._ + "" + [($.default /.name) + ($.default /.short_code) + ($.default /.long_code) + ($.default /.numeric_code) + ($.default /.equivalence) + ($.default /.hash) + ..items/ab + ..items/cd + ..items/efg + ..items/hijkl + ..items/mno + ..items/pqrs + ..items/tuvwxyz + + ($.documentation /.Territory + "An ISO 3166 territory.")] + []))) diff --git a/stdlib/source/library/lux/locale.lux b/stdlib/source/library/lux/locale.lux deleted file mode 100644 index 6cd384586..000000000 --- a/stdlib/source/library/lux/locale.lux +++ /dev/null @@ -1,47 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)] - ["[0]" hash (.only Hash)]] - [control - ["[0]" maybe (.use "[1]#[0]" functor)]] - [data - ["[0]" text (.only) - ["%" \\format (.only format)] - ["[0]" encoding (.only Encoding)]]] - [meta - [type - [primitive (.except)]]]]] - [/ - ["[0]" language (.only Language)] - ["[0]" territory (.only Territory)]]) - -(primitive .public Locale - Text - - (def territory_separator "_") - (def encoding_separator ".") - - (def .public (locale language territory encoding) - (-> Language (Maybe Territory) (Maybe Encoding) Locale) - (abstraction (format (language.code language) - (|> territory - (maybe#each (|>> territory.long_code (format ..territory_separator))) - (maybe.else "")) - (|> encoding - (maybe#each (|>> encoding.name (format ..encoding_separator))) - (maybe.else ""))))) - - (def .public code - (-> Locale Text) - (|>> representation)) - - (def .public hash - (Hash Locale) - (at hash.functor each ..code text.hash)) - - (def .public equivalence - (Equivalence Locale) - (at ..hash equivalence)) - ) diff --git a/stdlib/source/library/lux/locale/language.lux b/stdlib/source/library/lux/locale/language.lux deleted file mode 100644 index ae11c87b1..000000000 --- a/stdlib/source/library/lux/locale/language.lux +++ /dev/null @@ -1,575 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)] - [hash (.only Hash)]] - [data - ["[0]" text]] - [meta - [macro - ["[0]" template]] - [type - [primitive (.except)]]]]]) - -... https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes -(primitive .public Language - (Record - [#name Text - #code Text]) - - (with_template [ ] - [(def .public - (-> Language Text) - (|>> representation (the )))] - - [name #name] - [code #code] - ) - - (with_template [] - [(with_expansions [' (template.spliced )] - (with_template [ +] - [(def .public - Language - (abstraction [#name - #code ])) - (`` (with_template [] - [(def .public - Language - )] - - (,, (template.spliced +))))] - - ' - ))] - - [[["mis" "uncoded languages" uncoded []] - ["mul" "multiple languages" multiple []] - ["und" "undetermined" undetermined []] - ["zxx" "no linguistic content; not applicable" not_applicable []]]] - - [[["aar" "Afar" afar []] - ["abk" "Abkhazian" abkhazian []] - ["ace" "Achinese" achinese []] - ["ach" "Acoli" acoli []] - ["ada" "Adangme" adangme []] - ["ady" "Adyghe; Adygei" adyghe []] - ["afa" "Afro-Asiatic languages" afro_asiatic []] - ["afh" "Afrihili" afrihili []] - ["afr" "Afrikaans" afrikaans []] - ["ain" "Ainu" ainu []] - ["aka" "Akan" akan []] - ["akk" "Akkadian" akkadian []] - ["ale" "Aleut" aleut []] - ["alg" "Algonquian languages" algonquian []] - ["alt" "Southern Altai" southern_altai []] - ["amh" "Amharic" amharic []] - ["ang" "Old English (ca.450–1100)" old_english []] - ["anp" "Angika" angika []] - ["apa" "Apache languages" apache []] - ["ara" "Arabic" arabic []] - ["arc" "Official Aramaic (700–300 BCE); Imperial Aramaic (700–300 BCE)" official_aramaic [[imperial_aramaic]]] - ["arg" "Aragonese" aragonese []] - ["arn" "Mapudungun; Mapuche" mapudungun []] - ["arp" "Arapaho" arapaho []] - ["art" "Artificial languages" artificial []] - ["arw" "Arawak" arawak []] - ["asm" "Assamese" assamese []] - ["ast" "Asturian; Bable; Leonese; Asturleonese" asturian [[bable] [leonese] [asturleonese]]] - ["ath" "Athapascan languages" athapascan []] - ["aus" "Australian languages" australian []] - ["ava" "Avaric" avaric []] - ["ave" "Avestan" avestan []] - ["awa" "Awadhi" awadhi []] - ["aym" "Aymara" aymara []] - ["aze" "Azerbaijani" azerbaijani []]]] - - [[["bad" "Banda languages" banda []] - ["bai" "Bamileke languages" bamileke []] - ["bak" "Bashkir" bashkir []] - ["bal" "Baluchi" baluchi []] - ["bam" "Bambara" bambara []] - ["ban" "Balinese" balinese []] - ["bas" "Basa" basa []] - ["bat" "Baltic languages" baltic []] - ["bej" "Beja; Bedawiyet" beja []] - ["bel" "Belarusian" belarusian []] - ["bem" "Bemba" bemba []] - ["ben" "Bengali" bengali []] - ["ber" "Berber languages" berber []] - ["bho" "Bhojpuri" bhojpuri []] - ["bih" "Bihari languages" bihari []] - ["bik" "Bikol" bikol []] - ["bin" "Bini; Edo" bini [[edo]]] - ["bis" "Bislama" bislama []] - ["bla" "Siksika" siksika []] - ["bnt" "Bantu languages" bantu []] - ["bod" "Tibetan" tibetan []] - ["bos" "Bosnian" bosnian []] - ["bra" "Braj" braj []] - ["bre" "Breton" breton []] - ["btk" "Batak languages" batak []] - ["bua" "Buriat" buriat []] - ["bug" "Buginese" buginese []] - ["bul" "Bulgarian" bulgarian []] - ["byn" "Blin; Bilin" blin [[bilin]]]]] - - [[["cad" "Caddo" caddo []] - ["cai" "Central American Indian languages" central_american_indian []] - ["car" "Galibi Carib" galibi_carib []] - ["cat" "Catalan; Valencian" catalan [[valencian]]] - ["cau" "Caucasian languages" caucasian []] - ["ceb" "Cebuano" cebuano []] - ["cel" "Celtic languages" celtic []] - ["ces" "Czech" czech []] - ["cha" "Chamorro" chamorro []] - ["chb" "Chibcha" chibcha []] - ["che" "Chechen" chechen []] - ["chg" "Chagatai" chagatai []] - ["chk" "Chuukese" chuukese []] - ["chm" "Mari" mari []] - ["chn" "Chinook jargon" chinook []] - ["cho" "Choctaw" choctaw []] - ["chp" "Chipewyan; Dene Suline" chipewyan []] - ["chr" "Cherokee" cherokee []] - ["chu" "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic" church_slavic [[old_slavonic] [church_slavonic] [old_bulgarian] [old_church_slavonic]]] - ["chv" "Chuvash" chuvash []] - ["chy" "Cheyenne" cheyenne []] - ["cmc" "Chamic languages" chamic []] - ["cnr" "Montenegrin" montenegrin []] - ["cop" "Coptic" coptic []] - ["cor" "Cornish" cornish []] - ["cos" "Corsican" corsican []] - ["cpe" "Creoles and pidgins, English based" creoles_and_pidgins/english []] - ["cpf" "Creoles and pidgins, French-based" creoles_and_pidgins/french []] - ["cpp" "Creoles and pidgins, Portuguese-based" creoles_and_pidgins/portuguese []] - ["cre" "Cree" cree []] - ["crh" "Crimean Tatar; Crimean Turkish" crimean []] - ["crp" "Creoles and pidgins" creoles_and_pidgins []] - ["csb" "Kashubian" kashubian []] - ["cus" "Cushitic languages" cushitic []] - ["cym" "Welsh" welsh []]]] - - [[["dak" "Dakota" dakota []] - ["dan" "Danish" danish []] - ["dar" "Dargwa" dargwa []] - ["day" "Land Dayak languages" land_dayak []] - ["del" "Delaware" delaware []] - ["den" "Slave (Athapascan)" slavey []] - ["deu" "German" german []] - ["dgr" "Dogrib" dogrib []] - ["din" "Dinka" dinka []] - ["div" "Divehi; Dhivehi; Maldivian" dhivehi [[maldivian]]] - ["doi" "Dogri" dogri []] - ["dra" "Dravidian languages" dravidian []] - ["dsb" "Lower Sorbian" lower_sorbian []] - ["dua" "Duala" duala []] - ["dum" "Middle Dutch (ca. 1050–1350)" middle_dutch []] - ["dyu" "Dyula" dyula []] - ["dzo" "Dzongkha" dzongkha []]]] - - [[["efi" "Efik" efik []] - ["egy" "Ancient Egyptian" egyptian []] - ["eka" "Ekajuk" ekajuk []] - ["ell" "Modern Greek (1453–)" greek []] - ["elx" "Elamite" elamite []] - ["eng" "English" english []] - ["enm" "Middle English (1100–1500)" middle_english []] - ["epo" "Esperanto" esperanto []] - ["est" "Estonian" estonian []] - ["eus" "Basque" basque []] - ["ewe" "Ewe" ewe []] - ["ewo" "Ewondo" ewondo []]]] - - [[["fan" "Fang" fang []] - ["fao" "Faroese" faroese []] - ["fas" "Persian" persian []] - ["fat" "Fanti" fanti []] - ["fij" "Fijian" fijian []] - ["fil" "Filipino; Pilipino" filipino []] - ["fin" "Finnish" finnish []] - ["fiu" "Finno-Ugrian languages" finno_ugrian []] - ["fon" "Fon" fon []] - ["fra" "French" french []] - ["frm" "Middle French (ca. 1400–1600)" middle_french []] - ["fro" "Old French (ca. 842–1400)" old_french []] - ["frr" "Northern Frisian" northern_frisian []] - ["frs" "Eastern Frisian" eastern_frisian []] - ["fry" "Western Frisian" western_frisian []] - ["ful" "Fulah" fulah []] - ["fur" "Friulian" friulian []]]] - - [[["gaa" "Ga" ga []] - ["gay" "Gayo" gayo []] - ["gba" "Gbaya" gbaya []] - ["gem" "Germanic languages" germanic []] - ["gez" "Geez" geez []] - ["gil" "Gilbertese" gilbertese []] - ["gla" "Gaelic; Scottish Gaelic" gaelic []] - ["gle" "Irish" irish []] - ["glg" "Galician" galician []] - ["glv" "Manx" manx []] - ["gmh" "Middle High German (ca. 1050–1500)" middle_high_german []] - ["goh" "Old High German (ca. 750–1050)" old_high_german []] - ["gon" "Gondi" gondi []] - ["gor" "Gorontalo" gorontalo []] - ["got" "Gothic" gothic []] - ["grb" "Grebo" grebo []] - ["grc" "Ancient Greek (to 1453)" ancient_greek []] - ["grn" "Guarani" guarani []] - ["gsw" "Swiss German; Alemannic; Alsatian" swiss_german [[alemannic] [alsatian]]] - ["guj" "Gujarati" gujarati []] - ["gwi" "Gwich'in" gwich'in []]]] - - [[["hai" "Haida" haida []] - ["hat" "Haitian; Haitian Creole" haitian []] - ["hau" "Hausa" hausa []] - ["haw" "Hawaiian" hawaiian []] - ["heb" "Hebrew" hebrew []] - ["her" "Herero" herero []] - ["hil" "Hiligaynon" hiligaynon []] - ["him" "Himachali languages; Pahari languages" himachali []] - ["hin" "Hindi" hindi []] - ["hit" "Hittite" hittite []] - ["hmn" "Hmong; Mong" hmong []] - ["hmo" "Hiri Motu" hiri_motu []] - ["hrv" "Croatian" croatian []] - ["hsb" "Upper Sorbian" upper_sorbian []] - ["hun" "Hungarian" hungarian []] - ["hup" "Hupa" hupa []] - ["hye" "Armenian" armenian []]]] - - [[["iba" "Iban" iban []] - ["ibo" "Igbo" igbo []] - ["ido" "Ido" ido []] - ["iii" "Sichuan Yi; Nuosu" sichuan_yi [[nuosu]]] - ["ijo" "Ijo languages" ijo []] - ["iku" "Inuktitut" inuktitut []] - ["ile" "Interlingue; Occidental" interlingue []] - ["ilo" "Iloko" iloko []] - ["ina" "Interlingua (International Auxiliary Language Association)" interlingua []] - ["inc" "Indic languages" indic []] - ["ind" "Indonesian" indonesian []] - ["ine" "Indo-European languages" indo_european []] - ["inh" "Ingush" ingush []] - ["ipk" "Inupiaq" inupiaq []] - ["ira" "Iranian languages" iranian []] - ["iro" "Iroquoian languages" iroquoian []] - ["isl" "Icelandic" icelandic []] - ["ita" "Italian" italian []]]] - - [[["jav" "Javanese" javanese []] - ["jbo" "Lojban" lojban []] - ["jpn" "Japanese" japanese []] - ["jpr" "Judeo-Persian" judeo_persian []] - ["jrb" "Judeo-Arabic" judeo_arabic []]]] - - [[["kaa" "Kara-Kalpak" kara_kalpak []] - ["kab" "Kabyle" kabyle []] - ["kac" "Kachin; Jingpho" kachin [[jingpho]]] - ["kal" "Kalaallisut; Greenlandic" kalaallisut [[greenlandic]]] - ["kam" "Kamba" kamba []] - ["kan" "Kannada" kannada []] - ["kar" "Karen languages" karen []] - ["kas" "Kashmiri" kashmiri []] - ["kat" "Georgian" georgian []] - ["kau" "Kanuri" kanuri []] - ["kaw" "Kawi" kawi []] - ["kaz" "Kazakh" kazakh []] - ["kbd" "Kabardian" kabardian []] - ["kha" "Khasi" khasi []] - ["khi" "Khoisan languages" khoisan []] - ["khm" "Central Khmer" central_khmer []] - ["kho" "Khotanese; Sakan" khotanese [[sakan]]] - ["kik" "Kikuyu; Gikuyu" gikuyu []] - ["kin" "Kinyarwanda" kinyarwanda []] - ["kir" "Kirghiz; Kyrgyz" kyrgyz []] - ["kmb" "Kimbundu" kimbundu []] - ["kok" "Konkani" konkani []] - ["kom" "Komi" komi []] - ["kon" "Kongo" kongo []] - ["kor" "Korean" korean []] - ["kos" "Kosraean" kosraean []] - ["kpe" "Kpelle" kpelle []] - ["krc" "Karachay-Balkar" karachay_balkar []] - ["krl" "Karelian" karelian []] - ["kro" "Kru languages" kru []] - ["kru" "Kurukh" kurukh []] - ["kua" "Kuanyama; Kwanyama" kwanyama []] - ["kum" "Kumyk" kumyk []] - ["kur" "Kurdish" kurdish []] - ["kut" "Kutenai" kutenai []]]] - - [[["lad" "Ladino" ladino []] - ["lah" "Lahnda" lahnda []] - ["lam" "Lamba" lamba []] - ["lao" "Lao" lao []] - ["lat" "Latin" latin []] - ["lav" "Latvian" latvian []] - ["lez" "Lezghian" lezghian []] - ["lim" "Limburgan; Limburger; Limburgish" limburgan []] - ["lin" "Lingala" lingala []] - ["lit" "Lithuanian" lithuanian []] - ["lol" "Mongo" mongo []] - ["loz" "Lozi" lozi []] - ["ltz" "Luxembourgish; Letzeburgesch" luxembourgish []] - ["lua" "Luba-Lulua" luba_lulua []] - ["lub" "Luba-Katanga" luba_katanga []] - ["lug" "Ganda" ganda []] - ["lui" "Luiseno" luiseno []] - ["lun" "Lunda" lunda []] - ["luo" "Luo (Kenya and Tanzania)" luo []] - ["lus" "Lushai" lushai []]]] - - [[["mad" "Madurese" madurese []] - ["mag" "Magahi" magahi []] - ["mah" "Marshallese" marshallese []] - ["mai" "Maithili" maithili []] - ["mak" "Makasar" makasar []] - ["mal" "Malayalam" malayalam []] - ["man" "Mandingo" mandingo []] - ["map" "Austronesian languages" austronesian []] - ["mar" "Marathi" marathi []] - ["mas" "Masai" masai []] - ["mdf" "Moksha" moksha []] - ["mdr" "Mandar" mandar []] - ["men" "Mende" mende []] - ["mga" "Middle Irish (900–1200)" middle_irish []] - ["mic" "Mi'kmaq; Micmac" mi'kmaq [[micmac]]] - ["min" "Minangkabau" minangkabau []] - ["mkd" "Macedonian" macedonian []] - ["mkh" "Mon-Khmer languages" mon_khmer []] - ["mlg" "Malagasy" malagasy []] - ["mlt" "Maltese" maltese []] - ["mnc" "Manchu" manchu []] - ["mni" "Manipuri" manipuri []] - ["mno" "Manobo languages" manobo []] - ["moh" "Mohawk" mohawk []] - ["mon" "Mongolian" mongolian []] - ["mos" "Mossi" mossi []] - ["mri" "Maori" maori []] - ["msa" "Malay" malay []] - ["mun" "Munda languages" munda []] - ["mus" "Creek" creek []] - ["mwl" "Mirandese" mirandese []] - ["mwr" "Marwari" marwari []] - ["mya" "Burmese" burmese []] - ["myn" "Mayan languages" mayan []] - ["myv" "Erzya" erzya []]]] - - [[["nah" "Nahuatl languages" nahuatl []] - ["nai" "North American Indian languages" north_american_indian []] - ["nap" "Neapolitan" neapolitan []] - ["nau" "Nauru" nauru []] - ["nav" "Navajo; Navaho" navajo []] - ["nbl" "South Ndebele" south_ndebele []] - ["nde" "North Ndebele" north_ndebele []] - ["ndo" "Ndonga" ndonga []] - ["nds" "Low German; Low Saxon" low_german []] - ["nep" "Nepali" nepali []] - ["new" "Nepal Bhasa; Newari" newari [[nepal_bhasa]]] - ["nia" "Nias" nias []] - ["nic" "Niger-Kordofanian languages" niger_kordofanian []] - ["niu" "Niuean" niuean []] - ["nld" "Dutch; Flemish" dutch [[flemish]]] - ["nno" "Norwegian Nynorsk" nynorsk []] - ["nob" "Norwegian Bokmål" bokmal []] - ["nog" "Nogai" nogai []] - ["non" "Old Norse" old_norse []] - ["nor" "Norwegian" norwegian []] - ["nqo" "N'Ko" n'ko []] - ["nso" "Pedi; Sepedi; Northern Sotho" northern_sotho [[pedi] [sepedi]]] - ["nub" "Nubian languages" nubian []] - ["nwc" "Classical Newari; Old Newari; Classical Nepal Bhasa" old_newari [[classical_newari] [classical_nepal_bhasa]]] - ["nya" "Chichewa; Chewa; Nyanja" nyanja [[chichewa] [chewa]]] - ["nym" "Nyamwezi" nyamwezi []] - ["nyn" "Nyankole" nyankole []] - ["nyo" "Nyoro" nyoro []] - ["nzi" "Nzima" nzima []]]] - - [[["oci" "Occitan (post 1500); Provençal" occitan [[provencal]]] - ["oji" "Ojibwa" ojibwa []] - ["ori" "Oriya" oriya []] - ["orm" "Oromo" oromo []] - ["osa" "Osage" osage []] - ["oss" "Ossetian; Ossetic" ossetic []] - ["ota" "Ottoman Turkish (1500–1928)" ottoman_turkish []] - ["oto" "Otomian languages" otomian []]]] - - [[["paa" "Papuan languages" papuan []] - ["pag" "Pangasinan" pangasinan []] - ["pal" "Pahlavi" pahlavi []] - ["pam" "Pampanga; Kapampangan" pampanga [[kapampangan]]] - ["pan" "Panjabi; Punjabi" punjabi []] - ["pap" "Papiamento" papiamento []] - ["pau" "Palauan" palauan []] - ["peo" "Old Persian (ca. 600–400 B.C.)" old_persian []] - ["phi" "Philippine languages" philippine []] - ["phn" "Phoenician" phoenician []] - ["pli" "Pali" pali []] - ["pol" "Polish" polish []] - ["pon" "Pohnpeian" pohnpeian []] - ["por" "Portuguese" portuguese []] - ["pra" "Prakrit languages" prakrit []] - ["pro" "Old Provençal (to 1500); Old Occitan (to 1500)" old_provencal []] - ["pus" "Pushto; Pashto" pashto []]]] - - [[["que" "Quechua" quechua []]]] - - [[["raj" "Rajasthani" rajasthani []] - ["rap" "Rapanui" rapanui []] - ["rar" "Rarotongan; Cook Islands Maori" rarotongan [[cook_islands_maori]]] - ["roa" "Romance languages" romance []] - ["roh" "Romansh" romansh []] - ["rom" "Romany" romany []] - ["ron" "Romanian; Moldavian; Moldovan" romanian [[moldavian] [moldovan]]] - ["run" "Rundi" rundi []] - ["rup" "Aromanian; Arumanian; Macedo-Romanian" aromanian [[arumanian] [macedo_romanian]]] - ["rus" "Russian" russian []]]] - - [[["sad" "Sandawe" sandawe []] - ["sag" "Sango" sango []] - ["sah" "Yakut" yakut []] - ["sai" "South American Indian (Other)" south_american_indian []] - ["sal" "Salishan languages" salishan []] - ["sam" "Samaritan Aramaic" samaritan_aramaic []] - ["san" "Sanskrit" sanskrit []] - ["sas" "Sasak" sasak []] - ["sat" "Santali" santali []] - ["scn" "Sicilian" sicilian []] - ["sco" "Scots" scots []] - ["sel" "Selkup" selkup []] - ["sem" "Semitic languages" semitic []] - ["sga" "Old Irish (to 900)" old_irish []] - ["sgn" "Sign Languages" sign []] - ["shn" "Shan" shan []] - ["sid" "Sidamo" sidamo []] - ["sin" "Sinhala; Sinhalese" sinhalese []] - ["sio" "Siouan languages" siouan []] - ["sit" "Sino-Tibetan languages" sino_tibetan []] - ["sla" "Slavic languages" slavic []] - ["slk" "Slovak" slovak []] - ["slv" "Slovenian" slovenian []] - ["sma" "Southern Sami" southern_sami []] - ["sme" "Northern Sami" northern_sami []] - ["smi" "Sami languages" sami []] - ["smj" "Lule Sami" lule []] - ["smn" "Inari Sami" inari []] - ["smo" "Samoan" samoan []] - ["sms" "Skolt Sami" skolt_sami []] - ["sna" "Shona" shona []] - ["snd" "Sindhi" sindhi []] - ["snk" "Soninke" soninke []] - ["sog" "Sogdian" sogdian []] - ["som" "Somali" somali []] - ["son" "Songhai languages" songhai []] - ["sot" "Southern Sotho" southern_sotho []] - ["spa" "Spanish; Castilian" spanish [[castilian]]] - ["sqi" "Albanian" albanian []] - ["srd" "Sardinian" sardinian []] - ["srn" "Sranan Tongo" sranan_tongo []] - ["srp" "Serbian" serbian []] - ["srr" "Serer" serer []] - ["ssa" "Nilo-Saharan languages" nilo_saharan []] - ["ssw" "Swati" swati []] - ["suk" "Sukuma" sukuma []] - ["sun" "Sundanese" sundanese []] - ["sus" "Susu" susu []] - ["sux" "Sumerian" sumerian []] - ["swa" "Swahili" swahili []] - ["swe" "Swedish" swedish []] - ["syc" "Classical Syriac" classical_syriac []] - ["syr" "Syriac" syriac []]]] - - [[["tah" "Tahitian" tahitian []] - ["tai" "Tai languages" tai []] - ["tam" "Tamil" tamil []] - ["tat" "Tatar" tatar []] - ["tel" "Telugu" telugu []] - ["tem" "Timne" timne []] - ["ter" "Tereno" tereno []] - ["tet" "Tetum" tetum []] - ["tgk" "Tajik" tajik []] - ["tgl" "Tagalog" tagalog []] - ["tha" "Thai" thai []] - ["tig" "Tigre" tigre []] - ["tir" "Tigrinya" tigrinya []] - ["tiv" "Tiv" tiv []] - ["tkl" "Tokelau" tokelau []] - ["tlh" "Klingon; tlhIngan-Hol" klingon []] - ["tli" "Tlingit" tlingit []] - ["tmh" "Tamashek" tamashek []] - ["tog" "Tonga (Nyasa)" tonga []] - ["ton" "Tonga (Tonga Islands)" tongan []] - ["tpi" "Tok Pisin" tok_pisin []] - ["tsi" "Tsimshian" tsimshian []] - ["tsn" "Tswana" tswana []] - ["tso" "Tsonga" tsonga []] - ["tuk" "Turkmen" turkmen []] - ["tum" "Tumbuka" tumbuka []] - ["tup" "Tupi languages" tupi []] - ["tur" "Turkish" turkish []] - ["tut" "Altaic languages" altaic []] - ["tvl" "Tuvalu" tuvalu []] - ["twi" "Twi" twi []] - ["tyv" "Tuvinian" tuvinian []]]] - - [[["udm" "Udmurt" udmurt []] - ["uga" "Ugaritic" ugaritic []] - ["uig" "Uighur; Uyghur" uyghur []] - ["ukr" "Ukrainian" ukrainian []] - ["umb" "Umbundu" umbundu []] - ["urd" "Urdu" urdu []] - ["uzb" "Uzbek" uzbek []]]] - - [[["vai" "Vai" vai []] - ["ven" "Venda" venda []] - ["vie" "Vietnamese" vietnamese []] - ["vol" "Volapük" volapük []] - ["vot" "Votic" votic []]]] - - [[["wak" "Wakashan languages" wakashan []] - ["wal" "Wolaitta; Wolaytta" walamo []] - ["war" "Waray" waray []] - ["was" "Washo" washo []] - ["wen" "Sorbian languages" sorbian []] - ["wln" "Walloon" walloon []] - ["wol" "Wolof" wolof []]]] - - [[["xal" "Kalmyk; Oirat" kalmyk [[oirat]]] - ["xho" "Xhosa" xhosa []]]] - - [[["yao" "Yao" yao []] - ["yap" "Yapese" yapese []] - ["yid" "Yiddish" yiddish []] - ["yor" "Yoruba" yoruba []] - ["ypk" "Yupik languages" yupik []]]] - - [[["zap" "Zapotec" zapotec []] - ["zbl" "Blissymbols; Blissymbolics; Bliss" blissymbols []] - ["zen" "Zenaga" zenaga []] - ["zgh" "Standard Moroccan Tamazight" standard_moroccan_tamazight []] - ["zha" "Zhuang; Chuang" zhuang []] - ["zho" "Chinese" chinese []] - ["znd" "Zande languages" zande []] - ["zul" "Zulu" zulu []] - ["zun" "Zuni" zuni []] - ["zza" "Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki" zaza [[dimili] [dimli] [kirdki] [kirmanjki] [zazaki]]]]]) - - (def .public equivalence - (Equivalence Language) - (implementation - (def (= reference sample) - (same? reference sample)))) - - (def .public hash - (Hash Language) - (implementation - (def equivalence - ..equivalence) - - (def hash - (|>> ..code - (at text.hash hash))))) - ) diff --git a/stdlib/source/library/lux/locale/territory.lux b/stdlib/source/library/lux/locale/territory.lux deleted file mode 100644 index 74c30fce6..000000000 --- a/stdlib/source/library/lux/locale/territory.lux +++ /dev/null @@ -1,314 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)] - [hash (.only Hash)]] - [data - ["[0]" text]] - [meta - [macro - ["[0]" template]] - [type - [primitive (.except)]]]]]) - -... https://en.wikipedia.org/wiki/ISO_3166-1 -(primitive .public Territory - (Record - [#name Text - #short Text - #long Text - #code Nat]) - - (with_template [ ] - [(def .public - (-> Territory ) - (|>> representation - (the )))] - - [name #name Text] - [short_code #short Text] - [long_code #long Text] - [numeric_code #code Nat] - ) - - (with_template [
+] - [(def .public
- Territory - (abstraction [#name - #short - #long - #code ])) - - (`` (with_template [] - [(def .public Territory
)] - - (,, (template.spliced +))))] - - ["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 []] - ) - - (def .public equivalence - (Equivalence Territory) - (implementation - (def (= reference sample) - (same? reference sample)))) - - (def .public hash - (Hash Territory) - (implementation - (def equivalence ..equivalence) - - (def hash - (|>> representation - (the #long) - (at text.hash hash))))) - ) diff --git a/stdlib/source/library/lux/meta/macro/class.lux b/stdlib/source/library/lux/meta/macro/class.lux new file mode 100644 index 000000000..1c529d7cc --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/class.lux @@ -0,0 +1,55 @@ +... [Not everything is an expression](https://codewords.recurse.com/issues/two/not-everything-is-an-expression) + +(.require + [library + [lux (.except local) + [abstract + [monad (.only do)]] + [control + ["?" parser (.use "[1]#[0]" functor)] + ["[0]" exception (.only exception)]]]] + ["[0]" // (.only) + [syntax (.only syntax) + ["[0]" export]] + ["/[1]" // (.only) + ["[0]" code (.only) + ["?[1]" \\parser (.only Parser)]] + ["[0]" type (.only) + [primitive (.except)]]]]) + +(exception .public (invalid_type [expected Type + actual Type]) + (exception.report + (list ["Expected" (type.format expected)] + ["Actual" (type.format actual)]))) + +(def local + (Parser Code) + (?#each code.local ?code.local)) + +(def .public custom + (syntax (_ [[public|private ] + (export.parser (all ?.and + ..local + ..local + ..local + ..local))]) + (//.with_symbols [g!_ g!type g!value] + (in (list (` (primitive (, public|private) (, ) + Macro)) + + (` (def (, public|private) (, ) + (-> Macro (, )) + (|>> abstraction))) + + (` (def (, public|private) (, ) + (-> (, ) Macro) + (|>> representation))) + + (` (def (, public|private) ((, ) (, g!_)) + (-> Symbol (Meta (, ))) + ((,! do) (,! ///.monad) + [[(, g!_) (, g!type) (, g!value)] ((,! ///.export) (, g!_))] + (if (at (,! type.equivalence) (,' =) (, ) (, g!type)) + ((,' in) (as (, ) (, g!value))) + ((,! ///.failure) ((,! exception.except) ..invalid_type [(, ) (, g!type)]))))))))))) diff --git a/stdlib/source/library/lux/meta/macro/custom.lux b/stdlib/source/library/lux/meta/macro/custom.lux deleted file mode 100644 index 632219851..000000000 --- a/stdlib/source/library/lux/meta/macro/custom.lux +++ /dev/null @@ -1,53 +0,0 @@ -(.require - [library - [lux (.except local) - [abstract - [monad (.only do)]] - [control - ["?" parser (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]]]] - ["[0]" // (.only) - [syntax (.only syntax) - ["[0]" export]] - ["/[1]" // (.only) - ["[0]" code (.only) - ["?[1]" \\parser (.only Parser)]] - ["[0]" type (.only) - [primitive (.except)]]]]) - -(exception .public (invalid_type [expected Type - actual Type]) - (exception.report - (list ["Expected" (type.format expected)] - ["Actual" (type.format actual)]))) - -(def local - (Parser Code) - (?#each code.local ?code.local)) - -(def .public custom - (syntax (_ [[public|private ] - (export.parser (all ?.and - ..local - ..local - ..local - ..local))]) - (//.with_symbols [g!_ g!type g!value] - (in (list (` (primitive (, public|private) (, ) - Macro)) - - (` (def (, public|private) (, ) - (-> Macro (, )) - (|>> abstraction))) - - (` (def (, public|private) (, ) - (-> (, ) Macro) - (|>> representation))) - - (` (def (, public|private) ((, ) (, g!_)) - (-> Symbol (Meta (, ))) - ((,! do) (,! ///.monad) - [[(, g!_) (, g!type) (, g!value)] ((,! ///.export) (, g!_))] - (if (at (,! type.equivalence) (,' =) (, ) (, g!type)) - ((,' in) (as (, ) (, g!value))) - ((,! ///.failure) ((,! exception.except) ..invalid_type [(, ) (, g!type)]))))))))))) diff --git a/stdlib/source/library/lux/world/locale.lux b/stdlib/source/library/lux/world/locale.lux new file mode 100644 index 000000000..6cd384586 --- /dev/null +++ b/stdlib/source/library/lux/world/locale.lux @@ -0,0 +1,47 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)] + ["[0]" hash (.only Hash)]] + [control + ["[0]" maybe (.use "[1]#[0]" functor)]] + [data + ["[0]" text (.only) + ["%" \\format (.only format)] + ["[0]" encoding (.only Encoding)]]] + [meta + [type + [primitive (.except)]]]]] + [/ + ["[0]" language (.only Language)] + ["[0]" territory (.only Territory)]]) + +(primitive .public Locale + Text + + (def territory_separator "_") + (def encoding_separator ".") + + (def .public (locale language territory encoding) + (-> Language (Maybe Territory) (Maybe Encoding) Locale) + (abstraction (format (language.code language) + (|> territory + (maybe#each (|>> territory.long_code (format ..territory_separator))) + (maybe.else "")) + (|> encoding + (maybe#each (|>> encoding.name (format ..encoding_separator))) + (maybe.else ""))))) + + (def .public code + (-> Locale Text) + (|>> representation)) + + (def .public hash + (Hash Locale) + (at hash.functor each ..code text.hash)) + + (def .public equivalence + (Equivalence Locale) + (at ..hash equivalence)) + ) diff --git a/stdlib/source/library/lux/world/locale/language.lux b/stdlib/source/library/lux/world/locale/language.lux new file mode 100644 index 000000000..ae11c87b1 --- /dev/null +++ b/stdlib/source/library/lux/world/locale/language.lux @@ -0,0 +1,575 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)] + [hash (.only Hash)]] + [data + ["[0]" text]] + [meta + [macro + ["[0]" template]] + [type + [primitive (.except)]]]]]) + +... https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes +(primitive .public Language + (Record + [#name Text + #code Text]) + + (with_template [ ] + [(def .public + (-> Language Text) + (|>> representation (the )))] + + [name #name] + [code #code] + ) + + (with_template [] + [(with_expansions [' (template.spliced )] + (with_template [ +] + [(def .public + Language + (abstraction [#name + #code ])) + (`` (with_template [] + [(def .public + Language + )] + + (,, (template.spliced +))))] + + ' + ))] + + [[["mis" "uncoded languages" uncoded []] + ["mul" "multiple languages" multiple []] + ["und" "undetermined" undetermined []] + ["zxx" "no linguistic content; not applicable" not_applicable []]]] + + [[["aar" "Afar" afar []] + ["abk" "Abkhazian" abkhazian []] + ["ace" "Achinese" achinese []] + ["ach" "Acoli" acoli []] + ["ada" "Adangme" adangme []] + ["ady" "Adyghe; Adygei" adyghe []] + ["afa" "Afro-Asiatic languages" afro_asiatic []] + ["afh" "Afrihili" afrihili []] + ["afr" "Afrikaans" afrikaans []] + ["ain" "Ainu" ainu []] + ["aka" "Akan" akan []] + ["akk" "Akkadian" akkadian []] + ["ale" "Aleut" aleut []] + ["alg" "Algonquian languages" algonquian []] + ["alt" "Southern Altai" southern_altai []] + ["amh" "Amharic" amharic []] + ["ang" "Old English (ca.450–1100)" old_english []] + ["anp" "Angika" angika []] + ["apa" "Apache languages" apache []] + ["ara" "Arabic" arabic []] + ["arc" "Official Aramaic (700–300 BCE); Imperial Aramaic (700–300 BCE)" official_aramaic [[imperial_aramaic]]] + ["arg" "Aragonese" aragonese []] + ["arn" "Mapudungun; Mapuche" mapudungun []] + ["arp" "Arapaho" arapaho []] + ["art" "Artificial languages" artificial []] + ["arw" "Arawak" arawak []] + ["asm" "Assamese" assamese []] + ["ast" "Asturian; Bable; Leonese; Asturleonese" asturian [[bable] [leonese] [asturleonese]]] + ["ath" "Athapascan languages" athapascan []] + ["aus" "Australian languages" australian []] + ["ava" "Avaric" avaric []] + ["ave" "Avestan" avestan []] + ["awa" "Awadhi" awadhi []] + ["aym" "Aymara" aymara []] + ["aze" "Azerbaijani" azerbaijani []]]] + + [[["bad" "Banda languages" banda []] + ["bai" "Bamileke languages" bamileke []] + ["bak" "Bashkir" bashkir []] + ["bal" "Baluchi" baluchi []] + ["bam" "Bambara" bambara []] + ["ban" "Balinese" balinese []] + ["bas" "Basa" basa []] + ["bat" "Baltic languages" baltic []] + ["bej" "Beja; Bedawiyet" beja []] + ["bel" "Belarusian" belarusian []] + ["bem" "Bemba" bemba []] + ["ben" "Bengali" bengali []] + ["ber" "Berber languages" berber []] + ["bho" "Bhojpuri" bhojpuri []] + ["bih" "Bihari languages" bihari []] + ["bik" "Bikol" bikol []] + ["bin" "Bini; Edo" bini [[edo]]] + ["bis" "Bislama" bislama []] + ["bla" "Siksika" siksika []] + ["bnt" "Bantu languages" bantu []] + ["bod" "Tibetan" tibetan []] + ["bos" "Bosnian" bosnian []] + ["bra" "Braj" braj []] + ["bre" "Breton" breton []] + ["btk" "Batak languages" batak []] + ["bua" "Buriat" buriat []] + ["bug" "Buginese" buginese []] + ["bul" "Bulgarian" bulgarian []] + ["byn" "Blin; Bilin" blin [[bilin]]]]] + + [[["cad" "Caddo" caddo []] + ["cai" "Central American Indian languages" central_american_indian []] + ["car" "Galibi Carib" galibi_carib []] + ["cat" "Catalan; Valencian" catalan [[valencian]]] + ["cau" "Caucasian languages" caucasian []] + ["ceb" "Cebuano" cebuano []] + ["cel" "Celtic languages" celtic []] + ["ces" "Czech" czech []] + ["cha" "Chamorro" chamorro []] + ["chb" "Chibcha" chibcha []] + ["che" "Chechen" chechen []] + ["chg" "Chagatai" chagatai []] + ["chk" "Chuukese" chuukese []] + ["chm" "Mari" mari []] + ["chn" "Chinook jargon" chinook []] + ["cho" "Choctaw" choctaw []] + ["chp" "Chipewyan; Dene Suline" chipewyan []] + ["chr" "Cherokee" cherokee []] + ["chu" "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic" church_slavic [[old_slavonic] [church_slavonic] [old_bulgarian] [old_church_slavonic]]] + ["chv" "Chuvash" chuvash []] + ["chy" "Cheyenne" cheyenne []] + ["cmc" "Chamic languages" chamic []] + ["cnr" "Montenegrin" montenegrin []] + ["cop" "Coptic" coptic []] + ["cor" "Cornish" cornish []] + ["cos" "Corsican" corsican []] + ["cpe" "Creoles and pidgins, English based" creoles_and_pidgins/english []] + ["cpf" "Creoles and pidgins, French-based" creoles_and_pidgins/french []] + ["cpp" "Creoles and pidgins, Portuguese-based" creoles_and_pidgins/portuguese []] + ["cre" "Cree" cree []] + ["crh" "Crimean Tatar; Crimean Turkish" crimean []] + ["crp" "Creoles and pidgins" creoles_and_pidgins []] + ["csb" "Kashubian" kashubian []] + ["cus" "Cushitic languages" cushitic []] + ["cym" "Welsh" welsh []]]] + + [[["dak" "Dakota" dakota []] + ["dan" "Danish" danish []] + ["dar" "Dargwa" dargwa []] + ["day" "Land Dayak languages" land_dayak []] + ["del" "Delaware" delaware []] + ["den" "Slave (Athapascan)" slavey []] + ["deu" "German" german []] + ["dgr" "Dogrib" dogrib []] + ["din" "Dinka" dinka []] + ["div" "Divehi; Dhivehi; Maldivian" dhivehi [[maldivian]]] + ["doi" "Dogri" dogri []] + ["dra" "Dravidian languages" dravidian []] + ["dsb" "Lower Sorbian" lower_sorbian []] + ["dua" "Duala" duala []] + ["dum" "Middle Dutch (ca. 1050–1350)" middle_dutch []] + ["dyu" "Dyula" dyula []] + ["dzo" "Dzongkha" dzongkha []]]] + + [[["efi" "Efik" efik []] + ["egy" "Ancient Egyptian" egyptian []] + ["eka" "Ekajuk" ekajuk []] + ["ell" "Modern Greek (1453–)" greek []] + ["elx" "Elamite" elamite []] + ["eng" "English" english []] + ["enm" "Middle English (1100–1500)" middle_english []] + ["epo" "Esperanto" esperanto []] + ["est" "Estonian" estonian []] + ["eus" "Basque" basque []] + ["ewe" "Ewe" ewe []] + ["ewo" "Ewondo" ewondo []]]] + + [[["fan" "Fang" fang []] + ["fao" "Faroese" faroese []] + ["fas" "Persian" persian []] + ["fat" "Fanti" fanti []] + ["fij" "Fijian" fijian []] + ["fil" "Filipino; Pilipino" filipino []] + ["fin" "Finnish" finnish []] + ["fiu" "Finno-Ugrian languages" finno_ugrian []] + ["fon" "Fon" fon []] + ["fra" "French" french []] + ["frm" "Middle French (ca. 1400–1600)" middle_french []] + ["fro" "Old French (ca. 842–1400)" old_french []] + ["frr" "Northern Frisian" northern_frisian []] + ["frs" "Eastern Frisian" eastern_frisian []] + ["fry" "Western Frisian" western_frisian []] + ["ful" "Fulah" fulah []] + ["fur" "Friulian" friulian []]]] + + [[["gaa" "Ga" ga []] + ["gay" "Gayo" gayo []] + ["gba" "Gbaya" gbaya []] + ["gem" "Germanic languages" germanic []] + ["gez" "Geez" geez []] + ["gil" "Gilbertese" gilbertese []] + ["gla" "Gaelic; Scottish Gaelic" gaelic []] + ["gle" "Irish" irish []] + ["glg" "Galician" galician []] + ["glv" "Manx" manx []] + ["gmh" "Middle High German (ca. 1050–1500)" middle_high_german []] + ["goh" "Old High German (ca. 750–1050)" old_high_german []] + ["gon" "Gondi" gondi []] + ["gor" "Gorontalo" gorontalo []] + ["got" "Gothic" gothic []] + ["grb" "Grebo" grebo []] + ["grc" "Ancient Greek (to 1453)" ancient_greek []] + ["grn" "Guarani" guarani []] + ["gsw" "Swiss German; Alemannic; Alsatian" swiss_german [[alemannic] [alsatian]]] + ["guj" "Gujarati" gujarati []] + ["gwi" "Gwich'in" gwich'in []]]] + + [[["hai" "Haida" haida []] + ["hat" "Haitian; Haitian Creole" haitian []] + ["hau" "Hausa" hausa []] + ["haw" "Hawaiian" hawaiian []] + ["heb" "Hebrew" hebrew []] + ["her" "Herero" herero []] + ["hil" "Hiligaynon" hiligaynon []] + ["him" "Himachali languages; Pahari languages" himachali []] + ["hin" "Hindi" hindi []] + ["hit" "Hittite" hittite []] + ["hmn" "Hmong; Mong" hmong []] + ["hmo" "Hiri Motu" hiri_motu []] + ["hrv" "Croatian" croatian []] + ["hsb" "Upper Sorbian" upper_sorbian []] + ["hun" "Hungarian" hungarian []] + ["hup" "Hupa" hupa []] + ["hye" "Armenian" armenian []]]] + + [[["iba" "Iban" iban []] + ["ibo" "Igbo" igbo []] + ["ido" "Ido" ido []] + ["iii" "Sichuan Yi; Nuosu" sichuan_yi [[nuosu]]] + ["ijo" "Ijo languages" ijo []] + ["iku" "Inuktitut" inuktitut []] + ["ile" "Interlingue; Occidental" interlingue []] + ["ilo" "Iloko" iloko []] + ["ina" "Interlingua (International Auxiliary Language Association)" interlingua []] + ["inc" "Indic languages" indic []] + ["ind" "Indonesian" indonesian []] + ["ine" "Indo-European languages" indo_european []] + ["inh" "Ingush" ingush []] + ["ipk" "Inupiaq" inupiaq []] + ["ira" "Iranian languages" iranian []] + ["iro" "Iroquoian languages" iroquoian []] + ["isl" "Icelandic" icelandic []] + ["ita" "Italian" italian []]]] + + [[["jav" "Javanese" javanese []] + ["jbo" "Lojban" lojban []] + ["jpn" "Japanese" japanese []] + ["jpr" "Judeo-Persian" judeo_persian []] + ["jrb" "Judeo-Arabic" judeo_arabic []]]] + + [[["kaa" "Kara-Kalpak" kara_kalpak []] + ["kab" "Kabyle" kabyle []] + ["kac" "Kachin; Jingpho" kachin [[jingpho]]] + ["kal" "Kalaallisut; Greenlandic" kalaallisut [[greenlandic]]] + ["kam" "Kamba" kamba []] + ["kan" "Kannada" kannada []] + ["kar" "Karen languages" karen []] + ["kas" "Kashmiri" kashmiri []] + ["kat" "Georgian" georgian []] + ["kau" "Kanuri" kanuri []] + ["kaw" "Kawi" kawi []] + ["kaz" "Kazakh" kazakh []] + ["kbd" "Kabardian" kabardian []] + ["kha" "Khasi" khasi []] + ["khi" "Khoisan languages" khoisan []] + ["khm" "Central Khmer" central_khmer []] + ["kho" "Khotanese; Sakan" khotanese [[sakan]]] + ["kik" "Kikuyu; Gikuyu" gikuyu []] + ["kin" "Kinyarwanda" kinyarwanda []] + ["kir" "Kirghiz; Kyrgyz" kyrgyz []] + ["kmb" "Kimbundu" kimbundu []] + ["kok" "Konkani" konkani []] + ["kom" "Komi" komi []] + ["kon" "Kongo" kongo []] + ["kor" "Korean" korean []] + ["kos" "Kosraean" kosraean []] + ["kpe" "Kpelle" kpelle []] + ["krc" "Karachay-Balkar" karachay_balkar []] + ["krl" "Karelian" karelian []] + ["kro" "Kru languages" kru []] + ["kru" "Kurukh" kurukh []] + ["kua" "Kuanyama; Kwanyama" kwanyama []] + ["kum" "Kumyk" kumyk []] + ["kur" "Kurdish" kurdish []] + ["kut" "Kutenai" kutenai []]]] + + [[["lad" "Ladino" ladino []] + ["lah" "Lahnda" lahnda []] + ["lam" "Lamba" lamba []] + ["lao" "Lao" lao []] + ["lat" "Latin" latin []] + ["lav" "Latvian" latvian []] + ["lez" "Lezghian" lezghian []] + ["lim" "Limburgan; Limburger; Limburgish" limburgan []] + ["lin" "Lingala" lingala []] + ["lit" "Lithuanian" lithuanian []] + ["lol" "Mongo" mongo []] + ["loz" "Lozi" lozi []] + ["ltz" "Luxembourgish; Letzeburgesch" luxembourgish []] + ["lua" "Luba-Lulua" luba_lulua []] + ["lub" "Luba-Katanga" luba_katanga []] + ["lug" "Ganda" ganda []] + ["lui" "Luiseno" luiseno []] + ["lun" "Lunda" lunda []] + ["luo" "Luo (Kenya and Tanzania)" luo []] + ["lus" "Lushai" lushai []]]] + + [[["mad" "Madurese" madurese []] + ["mag" "Magahi" magahi []] + ["mah" "Marshallese" marshallese []] + ["mai" "Maithili" maithili []] + ["mak" "Makasar" makasar []] + ["mal" "Malayalam" malayalam []] + ["man" "Mandingo" mandingo []] + ["map" "Austronesian languages" austronesian []] + ["mar" "Marathi" marathi []] + ["mas" "Masai" masai []] + ["mdf" "Moksha" moksha []] + ["mdr" "Mandar" mandar []] + ["men" "Mende" mende []] + ["mga" "Middle Irish (900–1200)" middle_irish []] + ["mic" "Mi'kmaq; Micmac" mi'kmaq [[micmac]]] + ["min" "Minangkabau" minangkabau []] + ["mkd" "Macedonian" macedonian []] + ["mkh" "Mon-Khmer languages" mon_khmer []] + ["mlg" "Malagasy" malagasy []] + ["mlt" "Maltese" maltese []] + ["mnc" "Manchu" manchu []] + ["mni" "Manipuri" manipuri []] + ["mno" "Manobo languages" manobo []] + ["moh" "Mohawk" mohawk []] + ["mon" "Mongolian" mongolian []] + ["mos" "Mossi" mossi []] + ["mri" "Maori" maori []] + ["msa" "Malay" malay []] + ["mun" "Munda languages" munda []] + ["mus" "Creek" creek []] + ["mwl" "Mirandese" mirandese []] + ["mwr" "Marwari" marwari []] + ["mya" "Burmese" burmese []] + ["myn" "Mayan languages" mayan []] + ["myv" "Erzya" erzya []]]] + + [[["nah" "Nahuatl languages" nahuatl []] + ["nai" "North American Indian languages" north_american_indian []] + ["nap" "Neapolitan" neapolitan []] + ["nau" "Nauru" nauru []] + ["nav" "Navajo; Navaho" navajo []] + ["nbl" "South Ndebele" south_ndebele []] + ["nde" "North Ndebele" north_ndebele []] + ["ndo" "Ndonga" ndonga []] + ["nds" "Low German; Low Saxon" low_german []] + ["nep" "Nepali" nepali []] + ["new" "Nepal Bhasa; Newari" newari [[nepal_bhasa]]] + ["nia" "Nias" nias []] + ["nic" "Niger-Kordofanian languages" niger_kordofanian []] + ["niu" "Niuean" niuean []] + ["nld" "Dutch; Flemish" dutch [[flemish]]] + ["nno" "Norwegian Nynorsk" nynorsk []] + ["nob" "Norwegian Bokmål" bokmal []] + ["nog" "Nogai" nogai []] + ["non" "Old Norse" old_norse []] + ["nor" "Norwegian" norwegian []] + ["nqo" "N'Ko" n'ko []] + ["nso" "Pedi; Sepedi; Northern Sotho" northern_sotho [[pedi] [sepedi]]] + ["nub" "Nubian languages" nubian []] + ["nwc" "Classical Newari; Old Newari; Classical Nepal Bhasa" old_newari [[classical_newari] [classical_nepal_bhasa]]] + ["nya" "Chichewa; Chewa; Nyanja" nyanja [[chichewa] [chewa]]] + ["nym" "Nyamwezi" nyamwezi []] + ["nyn" "Nyankole" nyankole []] + ["nyo" "Nyoro" nyoro []] + ["nzi" "Nzima" nzima []]]] + + [[["oci" "Occitan (post 1500); Provençal" occitan [[provencal]]] + ["oji" "Ojibwa" ojibwa []] + ["ori" "Oriya" oriya []] + ["orm" "Oromo" oromo []] + ["osa" "Osage" osage []] + ["oss" "Ossetian; Ossetic" ossetic []] + ["ota" "Ottoman Turkish (1500–1928)" ottoman_turkish []] + ["oto" "Otomian languages" otomian []]]] + + [[["paa" "Papuan languages" papuan []] + ["pag" "Pangasinan" pangasinan []] + ["pal" "Pahlavi" pahlavi []] + ["pam" "Pampanga; Kapampangan" pampanga [[kapampangan]]] + ["pan" "Panjabi; Punjabi" punjabi []] + ["pap" "Papiamento" papiamento []] + ["pau" "Palauan" palauan []] + ["peo" "Old Persian (ca. 600–400 B.C.)" old_persian []] + ["phi" "Philippine languages" philippine []] + ["phn" "Phoenician" phoenician []] + ["pli" "Pali" pali []] + ["pol" "Polish" polish []] + ["pon" "Pohnpeian" pohnpeian []] + ["por" "Portuguese" portuguese []] + ["pra" "Prakrit languages" prakrit []] + ["pro" "Old Provençal (to 1500); Old Occitan (to 1500)" old_provencal []] + ["pus" "Pushto; Pashto" pashto []]]] + + [[["que" "Quechua" quechua []]]] + + [[["raj" "Rajasthani" rajasthani []] + ["rap" "Rapanui" rapanui []] + ["rar" "Rarotongan; Cook Islands Maori" rarotongan [[cook_islands_maori]]] + ["roa" "Romance languages" romance []] + ["roh" "Romansh" romansh []] + ["rom" "Romany" romany []] + ["ron" "Romanian; Moldavian; Moldovan" romanian [[moldavian] [moldovan]]] + ["run" "Rundi" rundi []] + ["rup" "Aromanian; Arumanian; Macedo-Romanian" aromanian [[arumanian] [macedo_romanian]]] + ["rus" "Russian" russian []]]] + + [[["sad" "Sandawe" sandawe []] + ["sag" "Sango" sango []] + ["sah" "Yakut" yakut []] + ["sai" "South American Indian (Other)" south_american_indian []] + ["sal" "Salishan languages" salishan []] + ["sam" "Samaritan Aramaic" samaritan_aramaic []] + ["san" "Sanskrit" sanskrit []] + ["sas" "Sasak" sasak []] + ["sat" "Santali" santali []] + ["scn" "Sicilian" sicilian []] + ["sco" "Scots" scots []] + ["sel" "Selkup" selkup []] + ["sem" "Semitic languages" semitic []] + ["sga" "Old Irish (to 900)" old_irish []] + ["sgn" "Sign Languages" sign []] + ["shn" "Shan" shan []] + ["sid" "Sidamo" sidamo []] + ["sin" "Sinhala; Sinhalese" sinhalese []] + ["sio" "Siouan languages" siouan []] + ["sit" "Sino-Tibetan languages" sino_tibetan []] + ["sla" "Slavic languages" slavic []] + ["slk" "Slovak" slovak []] + ["slv" "Slovenian" slovenian []] + ["sma" "Southern Sami" southern_sami []] + ["sme" "Northern Sami" northern_sami []] + ["smi" "Sami languages" sami []] + ["smj" "Lule Sami" lule []] + ["smn" "Inari Sami" inari []] + ["smo" "Samoan" samoan []] + ["sms" "Skolt Sami" skolt_sami []] + ["sna" "Shona" shona []] + ["snd" "Sindhi" sindhi []] + ["snk" "Soninke" soninke []] + ["sog" "Sogdian" sogdian []] + ["som" "Somali" somali []] + ["son" "Songhai languages" songhai []] + ["sot" "Southern Sotho" southern_sotho []] + ["spa" "Spanish; Castilian" spanish [[castilian]]] + ["sqi" "Albanian" albanian []] + ["srd" "Sardinian" sardinian []] + ["srn" "Sranan Tongo" sranan_tongo []] + ["srp" "Serbian" serbian []] + ["srr" "Serer" serer []] + ["ssa" "Nilo-Saharan languages" nilo_saharan []] + ["ssw" "Swati" swati []] + ["suk" "Sukuma" sukuma []] + ["sun" "Sundanese" sundanese []] + ["sus" "Susu" susu []] + ["sux" "Sumerian" sumerian []] + ["swa" "Swahili" swahili []] + ["swe" "Swedish" swedish []] + ["syc" "Classical Syriac" classical_syriac []] + ["syr" "Syriac" syriac []]]] + + [[["tah" "Tahitian" tahitian []] + ["tai" "Tai languages" tai []] + ["tam" "Tamil" tamil []] + ["tat" "Tatar" tatar []] + ["tel" "Telugu" telugu []] + ["tem" "Timne" timne []] + ["ter" "Tereno" tereno []] + ["tet" "Tetum" tetum []] + ["tgk" "Tajik" tajik []] + ["tgl" "Tagalog" tagalog []] + ["tha" "Thai" thai []] + ["tig" "Tigre" tigre []] + ["tir" "Tigrinya" tigrinya []] + ["tiv" "Tiv" tiv []] + ["tkl" "Tokelau" tokelau []] + ["tlh" "Klingon; tlhIngan-Hol" klingon []] + ["tli" "Tlingit" tlingit []] + ["tmh" "Tamashek" tamashek []] + ["tog" "Tonga (Nyasa)" tonga []] + ["ton" "Tonga (Tonga Islands)" tongan []] + ["tpi" "Tok Pisin" tok_pisin []] + ["tsi" "Tsimshian" tsimshian []] + ["tsn" "Tswana" tswana []] + ["tso" "Tsonga" tsonga []] + ["tuk" "Turkmen" turkmen []] + ["tum" "Tumbuka" tumbuka []] + ["tup" "Tupi languages" tupi []] + ["tur" "Turkish" turkish []] + ["tut" "Altaic languages" altaic []] + ["tvl" "Tuvalu" tuvalu []] + ["twi" "Twi" twi []] + ["tyv" "Tuvinian" tuvinian []]]] + + [[["udm" "Udmurt" udmurt []] + ["uga" "Ugaritic" ugaritic []] + ["uig" "Uighur; Uyghur" uyghur []] + ["ukr" "Ukrainian" ukrainian []] + ["umb" "Umbundu" umbundu []] + ["urd" "Urdu" urdu []] + ["uzb" "Uzbek" uzbek []]]] + + [[["vai" "Vai" vai []] + ["ven" "Venda" venda []] + ["vie" "Vietnamese" vietnamese []] + ["vol" "Volapük" volapük []] + ["vot" "Votic" votic []]]] + + [[["wak" "Wakashan languages" wakashan []] + ["wal" "Wolaitta; Wolaytta" walamo []] + ["war" "Waray" waray []] + ["was" "Washo" washo []] + ["wen" "Sorbian languages" sorbian []] + ["wln" "Walloon" walloon []] + ["wol" "Wolof" wolof []]]] + + [[["xal" "Kalmyk; Oirat" kalmyk [[oirat]]] + ["xho" "Xhosa" xhosa []]]] + + [[["yao" "Yao" yao []] + ["yap" "Yapese" yapese []] + ["yid" "Yiddish" yiddish []] + ["yor" "Yoruba" yoruba []] + ["ypk" "Yupik languages" yupik []]]] + + [[["zap" "Zapotec" zapotec []] + ["zbl" "Blissymbols; Blissymbolics; Bliss" blissymbols []] + ["zen" "Zenaga" zenaga []] + ["zgh" "Standard Moroccan Tamazight" standard_moroccan_tamazight []] + ["zha" "Zhuang; Chuang" zhuang []] + ["zho" "Chinese" chinese []] + ["znd" "Zande languages" zande []] + ["zul" "Zulu" zulu []] + ["zun" "Zuni" zuni []] + ["zza" "Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki" zaza [[dimili] [dimli] [kirdki] [kirmanjki] [zazaki]]]]]) + + (def .public equivalence + (Equivalence Language) + (implementation + (def (= reference sample) + (same? reference sample)))) + + (def .public hash + (Hash Language) + (implementation + (def equivalence + ..equivalence) + + (def hash + (|>> ..code + (at text.hash hash))))) + ) diff --git a/stdlib/source/library/lux/world/locale/territory.lux b/stdlib/source/library/lux/world/locale/territory.lux new file mode 100644 index 000000000..74c30fce6 --- /dev/null +++ b/stdlib/source/library/lux/world/locale/territory.lux @@ -0,0 +1,314 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)] + [hash (.only Hash)]] + [data + ["[0]" text]] + [meta + [macro + ["[0]" template]] + [type + [primitive (.except)]]]]]) + +... https://en.wikipedia.org/wiki/ISO_3166-1 +(primitive .public Territory + (Record + [#name Text + #short Text + #long Text + #code Nat]) + + (with_template [ ] + [(def .public + (-> Territory ) + (|>> representation + (the )))] + + [name #name Text] + [short_code #short Text] + [long_code #long Text] + [numeric_code #code Nat] + ) + + (with_template [
+] + [(def .public
+ Territory + (abstraction [#name + #short + #long + #code ])) + + (`` (with_template [] + [(def .public Territory
)] + + (,, (template.spliced +))))] + + ["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 []] + ) + + (def .public equivalence + (Equivalence Territory) + (implementation + (def (= reference sample) + (same? reference sample)))) + + (def .public hash + (Hash Territory) + (implementation + (def equivalence ..equivalence) + + (def hash + (|>> representation + (the #long) + (at text.hash hash))))) + ) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 7212f5fb4..23d89ee6e 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -47,7 +47,6 @@ ["[1][0]" debug] ["[1][0]" documentation] - ["[1][0]" locale] ["[1][0]" math] ["[1][0]" meta] @@ -1204,7 +1203,6 @@ /debug.test /documentation.test - /locale.test /math.test /meta.test diff --git a/stdlib/source/test/lux/locale.lux b/stdlib/source/test/lux/locale.lux deleted file mode 100644 index b7c99d34a..000000000 --- a/stdlib/source/test/lux/locale.lux +++ /dev/null @@ -1,98 +0,0 @@ -(.require - [library - [lux (.except) - ["_" test (.only Test)] - [abstract - [monad (.only do)] - [\\specification - ["$[0]" equivalence] - ["$[0]" hash]]] - [math - ["[0]" random (.only Random) (.use "[1]#[0]" monad)]] - [data - ["[0]" text (.use "[1]#[0]" equivalence) - ["[0]" encoding (.only Encoding)]] - [collection - ["[0]" list]]]]] - ["[0]" / - ["[1][0]" language] - ["[1][0]" territory]] - [\\library - ["[0]" / (.only) - ["[0]" language (.only Language)] - ["[0]" territory (.only Territory)]]]) - -(def random_language - (Random Language) - (random.either (random#in language.afar) - (random#in language.zaza))) - -(def random_territory - (Random Territory) - (random.either (random#in territory.afghanistan) - (random#in territory.zimbabwe))) - -(def random_encoding - (Random Encoding) - (random.either (random#in encoding.ascii) - (random#in encoding.koi8_u))) - -(def random_locale - (Random /.Locale) - (do random.monad - [language ..random_language - territory ..random_territory - encoding ..random_encoding] - (in (/.locale language {.#Some territory} {.#Some encoding})))) - -(def .public test - Test - (<| (_.covering /._) - (_.for [/.Locale]) - (all _.and - (_.for [/.equivalence] - ($equivalence.spec /.equivalence ..random_locale)) - (_.for [/.hash] - (do [! random.monad] - [fixed_language ..random_language - fixed_territory ..random_territory - fixed_encoding ..random_encoding] - (all _.and - (|> ..random_language - (at ! each (function (_ language) - (/.locale language {.#Some fixed_territory} {.#Some fixed_encoding}))) - ($hash.spec /.hash)) - (|> ..random_territory - (at ! each (function (_ territory) - (/.locale fixed_language {.#Some territory} {.#Some fixed_encoding}))) - ($hash.spec /.hash)) - (|> ..random_encoding - (at ! each (function (_ encoding) - (/.locale fixed_language {.#Some fixed_territory} {.#Some encoding}))) - ($hash.spec /.hash)) - ))) - - (do random.monad - [language ..random_language - territory ..random_territory - encoding ..random_encoding - .let [l_locale (/.locale language {.#None} {.#None}) - lt_locale (/.locale language {.#Some territory} {.#None}) - le_locale (/.locale language {.#None} {.#Some encoding}) - lte_locale (/.locale language {.#Some territory} {.#Some encoding})] - .let [language_check (and (text#= (language.code language) - (/.code l_locale)) - (list.every? (|>> /.code (text.starts_with? (language.code language))) - (list lt_locale le_locale lte_locale))) - territory_check (list.every? (|>> /.code (text.contains? (territory.long_code territory))) - (list lt_locale lte_locale)) - encoding_check (list.every? (|>> /.code (text.ends_with? (encoding.name encoding))) - (list le_locale lte_locale))]] - (_.coverage [/.locale /.code] - (and language_check - territory_check - encoding_check))) - - /language.test - /territory.test - ))) diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux deleted file mode 100644 index edabb90d2..000000000 --- a/stdlib/source/test/lux/locale/language.lux +++ /dev/null @@ -1,301 +0,0 @@ -(.require - [library - [lux (.except) - ["_" test (.only Test)] - [abstract - [monad (.only do)] - [hash (.only Hash)] - [\\specification - ["$[0]" hash]]] - [control - ["[0]" maybe]] - [data - ["[0]" text] - [collection - ["[0]" set (.only Set)] - ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - ["[0]" random (.only Random)] - [number - ["n" nat]]] - [meta - [macro - ["[0]" template]]]]] - [\\library - ["[0]" /]]) - -(type Bundle - (Record - [#amount Nat - #names (Set Text) - #codes (Set Text) - #languages (Set /.Language) - #test Test])) - -(with_template [ ] - [(def - Bundle - (let [amount (template.amount ) - languages (is (List /.Language) - (`` (list (,, (template.spliced )))))] - [#amount amount - #names (|> languages (list#each /.name) (set.of_list text.hash)) - #codes (|> languages (list#each /.code) (set.of_list text.hash)) - #languages (set.of_list /.hash languages) - #test (_.coverage - true)]))] - - [languages/a [/.afar /.abkhazian /.achinese /.acoli /.adangme - /.adyghe /.afro_asiatic /.afrihili /.afrikaans /.ainu - /.akan /.akkadian /.aleut /.algonquian /.southern_altai - /.amharic /.old_english /.angika /.apache /.arabic - /.official_aramaic /.aragonese /.mapudungun /.arapaho /.artificial - /.arawak /.assamese /.asturian /.athapascan /.australian - /.avaric /.avestan /.awadhi /.aymara /.azerbaijani]] - [languages/b [/.banda /.bamileke /.bashkir /.baluchi /.bambara - /.balinese /.basa /.baltic /.beja /.belarusian - /.bemba /.bengali /.berber /.bhojpuri /.bihari - /.bikol /.bini /.bislama /.siksika /.bantu - /.tibetan /.bosnian /.braj /.breton /.batak - /.buriat /.buginese /.bulgarian /.blin]] - [languages/c [/.caddo /.central_american_indian /.galibi_carib /.catalan /.caucasian - /.cebuano /.celtic /.czech /.chamorro /.chibcha - /.chechen /.chagatai /.chuukese /.mari /.chinook - /.choctaw /.chipewyan /.cherokee /.church_slavic /.chuvash - /.cheyenne /.chamic /.montenegrin /.coptic /.cornish - /.corsican /.creoles_and_pidgins/english /.creoles_and_pidgins/french /.creoles_and_pidgins/portuguese /.cree - /.crimean /.creoles_and_pidgins /.kashubian /.cushitic /.welsh]] - [languages/d [/.dakota /.danish /.dargwa /.land_dayak /.delaware - /.slavey /.dogrib /.dinka /.dhivehi /.dogri - /.dravidian /.lower_sorbian /.duala /.middle_dutch /.dyula - /.dzongkha]] - [languages/e [/.efik /.egyptian /.ekajuk /.greek /.elamite - /.english /.middle_english /.esperanto /.estonian /.basque - /.ewe /.ewondo]] - [languages/f [/.fang /.faroese /.persian /.fanti /.fijian - /.filipino /.finnish /.finno_ugrian /.fon /.french - /.middle_french /.old_french /.northern_frisian /.eastern_frisian /.western_frisian - /.fulah /.friulian]] - [languages/g [/.ga /.gayo /.gbaya /.germanic /.german - /.geez /.gilbertese /.gaelic /.irish /.galician - /.manx /.middle_high_german /.old_high_german /.gondi /.gorontalo - /.gothic /.grebo /.ancient_greek /.guarani /.swiss_german - /.gujarati /.gwich'in]] - [languages/h [/.haida /.haitian /.hausa /.hawaiian /.hebrew - /.herero /.hiligaynon /.himachali /.hindi /.hittite - /.hmong /.hiri_motu /.croatian /.upper_sorbian /.hungarian - /.hupa /.armenian]] - [languages/i [/.iban /.igbo /.ido /.sichuan_yi /.ijo - /.inuktitut /.interlingue /.iloko /.interlingua /.indic - /.indonesian /.indo_european /.ingush /.inupiaq /.iranian - /.iroquoian /.icelandic /.italian]] - [languages/j [/.javanese /.lojban /.japanese /.judeo_persian /.judeo_arabic]] - [languages/k [/.kara_kalpak /.kabyle /.kachin /.kalaallisut /.kamba - /.kannada /.karen /.kashmiri /.georgian /.kanuri - /.kawi /.kazakh /.kabardian /.khasi /.khoisan - /.central_khmer /.khotanese /.gikuyu /.kinyarwanda /.kyrgyz - /.kimbundu /.konkani /.komi /.kongo /.korean - /.kosraean /.kpelle /.karachay_balkar /.karelian /.kru - /.kurukh /.kwanyama /.kumyk /.kurdish /.kutenai]] - [languages/l [/.ladino /.lahnda /.lamba /.lao /.latin - /.latvian /.lezghian /.limburgan /.lingala /.lithuanian - /.mongo /.lozi /.luxembourgish /.luba_lulua /.luba_katanga - /.ganda /.luiseno /.lunda /.luo /.lushai]] - [languages/m [/.madurese /.magahi /.marshallese /.maithili /.makasar - /.malayalam /.mandingo /.austronesian /.marathi /.masai - /.moksha /.mandar /.mende /.middle_irish /.mi'kmaq - /.minangkabau /.macedonian /.mon_khmer /.malagasy /.maltese - /.manchu /.manipuri /.manobo /.mohawk /.mongolian - /.mossi /.maori /.malay /.munda /.creek - /.mirandese /.marwari /.burmese /.mayan /.erzya]] - [languages/n [/.nahuatl /.north_american_indian /.neapolitan /.nauru /.navajo - /.south_ndebele /.north_ndebele /.ndonga /.low_german /.nepali - /.newari /.nias /.niger_kordofanian /.niuean /.dutch - /.nynorsk /.bokmal /.nogai /.old_norse /.norwegian - /.n'ko /.northern_sotho /.nubian /.old_newari /.nyanja - /.nyamwezi /.nyankole /.nyoro /.nzima]] - [languages/o [/.occitan /.ojibwa /.oriya /.oromo /.osage - /.ossetic /.ottoman_turkish /.otomian]] - [languages/p [/.papuan /.pangasinan /.pahlavi /.pampanga /.punjabi - /.papiamento /.palauan /.old_persian /.philippine /.phoenician - /.pali /.polish /.pohnpeian /.portuguese /.prakrit - /.old_provencal /.pashto]] - [languages/q [/.quechua]] - [languages/r [/.rajasthani /.rapanui /.rarotongan /.romance /.romansh - /.romany /.romanian /.rundi /.aromanian /.russian]] - [languages/s0 [/.sandawe /.sango /.yakut /.south_american_indian /.salishan - /.samaritan_aramaic /.sanskrit /.sasak /.santali /.sicilian - /.scots /.selkup /.semitic /.old_irish /.sign - /.shan /.sidamo /.sinhalese /.siouan /.sino_tibetan - /.slavic /.slovak /.slovenian /.southern_sami /.northern_sami - /.sami /.lule /.inari /.samoan /.skolt_sami]] - [languages/s1 [/.shona /.sindhi /.soninke /.sogdian /.somali - /.songhai /.southern_sotho /.spanish /.albanian /.sardinian - /.sranan_tongo /.serbian /.serer /.nilo_saharan /.swati - /.sukuma /.sundanese /.susu /.sumerian /.swahili - /.swedish /.classical_syriac /.syriac]] - [languages/t [/.tahitian /.tai /.tamil /.tatar /.telugu - /.timne /.tereno /.tetum /.tajik /.tagalog - /.thai /.tigre /.tigrinya /.tiv /.tokelau - /.klingon /.tlingit /.tamashek /.tonga /.tongan - /.tok_pisin /.tsimshian /.tswana /.tsonga /.turkmen - /.tumbuka /.tupi /.turkish /.altaic /.tuvalu - /.twi /.tuvinian]] - [languages/u [/.udmurt /.ugaritic /.uyghur /.ukrainian /.umbundu - /.urdu /.uzbek]] - [languages/v [/.vai /.venda /.vietnamese /.volapük /.votic]] - [languages/w [/.wakashan /.walamo /.waray /.washo /.sorbian - /.walloon /.wolof]] - [languages/x [/.kalmyk /.xhosa]] - [languages/y [/.yao /.yapese /.yiddish /.yoruba /.yupik]] - [languages/z [/.zapotec /.blissymbols /.zenaga /.standard_moroccan_tamazight /.zhuang - /.chinese /.zande /.zulu /.zuni /.zaza]] - [languages/etc [/.uncoded /.multiple /.undetermined /.not_applicable]] - ) - -(def languages - (List Bundle) - (list ..languages/a - ..languages/b - ..languages/c - ..languages/d - ..languages/e - ..languages/f - ..languages/g - ..languages/h - ..languages/i - ..languages/j - ..languages/k - ..languages/l - ..languages/m - ..languages/n - ..languages/o - ..languages/p - ..languages/q - ..languages/r - ..languages/s0 - ..languages/s1 - ..languages/t - ..languages/u - ..languages/v - ..languages/w - ..languages/x - ..languages/y - ..languages/z - ..languages/etc - )) - -(def (aggregate lens hash territories) - (All (_ a) (-> (-> Bundle (Set a)) - (Hash a) - (List Bundle) - [Nat (Set a)])) - (list#mix (function (_ bundle [amount set]) - [(n.+ amount (the #amount bundle)) - (set.union set (lens bundle))]) - [0 (set.empty hash)] - territories)) - -(def languages_test - Test - (|> ..languages - list.reversed - (list#each (the #test)) - (list#mix _.and - (`` (all _.and - (,, (with_template [ ] - [(let [[amount set] (..aggregate (the ) ..languages)] - (_.coverage [] - (n.= amount (set.size set))))] - - [/.name #names text.hash] - [/.code #codes text.hash] - [/.equivalence #languages /.hash] - )) - ))))) - -(def !aliases - (template (_ ) - [(_.coverage - (list.every? (at /.equivalence = ) - (`` (list (,, (template.spliced ))))))])) - -(def aliases_test/0 - Test - (all _.and - ... A - (!aliases /.official_aramaic [/.imperial_aramaic]) - (!aliases /.asturian [/.bable /.leonese /.asturleonese]) - ... B - (!aliases /.bini [/.edo]) - (!aliases /.blin [/.bilin]) - ... C - (!aliases /.catalan [/.valencian]) - (!aliases /.church_slavic [/.old_slavonic /.church_slavonic /.old_bulgarian /.old_church_slavonic]) - ... D - (!aliases /.dhivehi [/.maldivian]) - ... G - (!aliases /.swiss_german [/.alemannic /.alsatian]) - ... I - (!aliases /.sichuan_yi [/.nuosu]) - ... K - (!aliases /.kachin [/.jingpho]) - (!aliases /.kalaallisut [/.greenlandic]) - (!aliases /.khotanese [/.sakan]) - )) - -(def aliases_test/1 - Test - (all _.and - ... M - (!aliases /.mi'kmaq [/.micmac]) - ... N - (!aliases /.newari [/.nepal_bhasa]) - (!aliases /.dutch [/.flemish]) - (!aliases /.northern_sotho [/.pedi /.sepedi]) - (!aliases /.old_newari [/.classical_newari /.classical_nepal_bhasa]) - (!aliases /.nyanja [/.chichewa /.chewa]) - ... O - (!aliases /.occitan [/.provencal]) - ... P - (!aliases /.pampanga [/.kapampangan]) - ... R - (!aliases /.rarotongan [/.cook_islands_maori]) - (!aliases /.romanian [/.moldavian /.moldovan]) - (!aliases /.aromanian [/.arumanian /.macedo_romanian]) - ... S - (!aliases /.spanish [/.castilian]) - ... X - (!aliases /.kalmyk [/.oirat]) - ... Z - (!aliases /.zaza [/.dimili /.dimli /.kirdki /.kirmanjki /.zazaki]) - )) - -(def aliases_test - Test - (all _.and - ..aliases_test/0 - ..aliases_test/1 - )) - -(def .public random - (Random /.Language) - (let [options (|> ..languages - (list#each (|>> (the #languages) set.list)) - list.together)] - (do [! random.monad] - [choice (at ! each (n.% (list.size options)) - random.nat)] - (in (maybe.trusted (list.item choice options)))))) - -(def .public test - Test - (<| (_.covering /._) - (_.for [/.Language]) - (all _.and - (_.for [/.hash] - ($hash.spec /.hash ..random)) - - ..languages_test - ..aliases_test - ))) diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux deleted file mode 100644 index 969fe32a1..000000000 --- a/stdlib/source/test/lux/locale/territory.lux +++ /dev/null @@ -1,227 +0,0 @@ -(.require - [library - [lux (.except) - ["_" test (.only Test)] - [abstract - [monad (.only do)] - [hash (.only Hash)] - [\\specification - ["$[0]" hash]]] - [control - ["[0]" maybe]] - [data - ["[0]" text] - [collection - ["[0]" set (.only Set)] - ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - ["[0]" random (.only Random)] - [number - ["n" nat]]] - [meta - [macro - ["[0]" template]]]]] - [\\library - ["[0]" /]]) - -(type Bundle - (Record - [#amount Nat - #names (Set Text) - #shorts (Set Text) - #longs (Set Text) - #numbers (Set Nat) - #territories (Set /.Territory) - #test Test])) - -(with_template [ ] - [(def - Bundle - (let [amount (template.amount ) - territories (`` (list (,, (template.spliced ))))] - [#amount amount - #names (|> territories (list#each /.name) (set.of_list text.hash)) - #shorts (|> territories (list#each /.short_code) (set.of_list text.hash)) - #longs (|> territories (list#each /.long_code) (set.of_list text.hash)) - #numbers (|> territories (list#each /.numeric_code) (set.of_list n.hash)) - #territories (|> territories (set.of_list /.hash)) - #test (_.coverage - true)]))] - - [territories/a [/.afghanistan /.aland_islands /.albania /.algeria /.american_samoa - /.andorra /.angola /.anguilla /.antarctica /.antigua - /.argentina /.armenia /.aruba /.australia /.austria - /.azerbaijan]] - [territories/b [/.the_bahamas /.bahrain /.bangladesh /.barbados /.belarus - /.belgium /.belize /.benin /.bermuda /.bhutan - /.bolivia /.bonaire /.bosnia /.botswana /.bouvet_island - /.brazil /.british_indian_ocean_territory /.brunei_darussalam /.bulgaria /.burkina_faso - /.burundi]] - [territories/c [/.cape_verde /.cambodia /.cameroon /.canada /.cayman_islands - /.central_african_republic /.chad /.chile /.china /.christmas_island - /.cocos_islands /.colombia /.comoros /.congo /.democratic_republic_of_the_congo - /.cook_islands /.costa_rica /.ivory_coast /.croatia /.cuba - /.curacao /.cyprus /.czech_republic]] - [territories/d [/.denmark /.djibouti /.dominica /.dominican_republic]] - [territories/e [/.ecuador /.egypt /.el_salvador /.equatorial_guinea /.eritrea - /.estonia /.eswatini /.ethiopia]] - [territories/f [/.falkland_islands /.faroe_islands /.fiji /.finland /.france - /.french_guiana /.french_polynesia /.french_southern_territories]] - [territories/g [/.gabon /.the_gambia /.georgia /.germany /.ghana - /.gibraltar /.greece /.greenland /.grenada /.guadeloupe - /.guam /.guatemala /.guernsey /.guinea /.guinea_bissau - /.guyana]] - [territories/h [/.haiti /.heard_island /.honduras /.hong_kong - /.hungary]] - [territories/i [/.iceland /.india /.indonesia /.iran /.iraq - /.ireland /.isle_of_man /.israel /.italy]] - [territories/j [/.jamaica /.japan /.jersey /.jordan]] - [territories/k [/.kazakhstan /.kenya /.kiribati /.north_korea /.south_korea - /.kuwait /.kyrgyzstan]] - [territories/l [/.laos /.latvia /.lebanon /.lesotho /.liberia - /.libya /.liechtenstein /.lithuania /.luxembourg]] - [territories/m [/.macau /.macedonia /.madagascar /.malawi /.malaysia - /.maldives /.mali /.malta /.marshall_islands /.martinique - /.mauritania /.mauritius /.mayotte /.mexico /.micronesia - /.moldova /.monaco /.mongolia /.montenegro /.montserrat - /.morocco /.mozambique /.myanmar]] - [territories/n [/.namibia /.nauru /.nepal /.netherlands /.new_caledonia - /.new_zealand /.nicaragua /.niger /.nigeria /.niue - /.norfolk_island /.northern_mariana_islands /.norway]] - [territories/o [/.oman]] - [territories/p [/.pakistan /.palau /.palestine /.panama /.papua_new_guinea - /.paraguay /.peru /.philippines /.pitcairn_islands /.poland - /.portugal /.puerto_rico]] - [territories/q [/.qatar]] - [territories/r [/.reunion /.romania /.russia /.rwanda]] - [territories/s [/.saint_barthelemy /.saint_helena /.saint_kitts /.saint_lucia /.saint_martin - /.saint_pierre /.saint_vincent /.samoa /.san_marino /.sao_tome - /.saudi_arabia /.senegal /.serbia /.seychelles /.sierra_leone - /.singapore /.sint_maarten /.slovakia /.slovenia /.solomon_islands - /.somalia /.south_africa /.south_georgia /.south_sudan /.spain - /.sri_lanka /.sudan /.suriname /.svalbard /.sweden - /.switzerland /.syria]] - [territories/t [/.taiwan /.tajikistan /.tanzania /.thailand /.east_timor - /.togo /.tokelau /.tonga /.trinidad /.tunisia - /.turkey /.turkmenistan /.turks /.tuvalu]] - [territories/u [/.uganda /.ukraine /.united_arab_emirates /.united_kingdom /.united_states_of_america - /.united_states_minor_outlying_islands /.uruguay /.uzbekistan]] - [territories/v [/.vanuatu /.vatican_city /.venezuela /.vietnam /.british_virgin_islands /.united_states_virgin_islands]] - [territories/w [/.wallis /.western_sahara]] - [territories/y [/.yemen]] - [territories/z [/.zambia /.zimbabwe]] - ) - -(def territories - (List Bundle) - (list ..territories/a - ..territories/b - ..territories/c - ..territories/d - ..territories/e - ..territories/f - ..territories/g - ..territories/h - ..territories/i - ..territories/j - ..territories/k - ..territories/l - ..territories/m - ..territories/n - ..territories/o - ..territories/p - ..territories/q - ..territories/r - ..territories/s - ..territories/t - ..territories/u - ..territories/v - ..territories/w - ..territories/y - ..territories/z)) - -(def (aggregate lens hash territories) - (All (_ a) (-> (-> Bundle (Set a)) - (Hash a) - (List Bundle) - [Nat (Set a)])) - (list#mix (function (_ bundle [amount set]) - [(n.+ amount (the #amount bundle)) - (set.union set (lens bundle))]) - [0 (set.empty hash)] - territories)) - -(def territories_test - Test - (|> ..territories - list.reversed - (list#each (the #test)) - (list#mix _.and - (`` (all _.and - (,, (with_template [ ] - [(let [[amount set] (..aggregate (the ) ..territories)] - (_.coverage [] - (n.= amount (set.size set))))] - - [/.name #names text.hash] - [/.short_code #shorts text.hash] - [/.long_code #longs text.hash] - [/.numeric_code #numbers n.hash] - [/.equivalence #territories /.hash] - )) - ))))) - -(def !aliases - (template (_ ) - [(_.coverage - (list.every? (at /.equivalence = ) - (`` (list (,, (template.spliced ))))))])) - -(def aliases_test - Test - (all _.and - ... A - (!aliases /.antigua [/.barbuda]) - ... B - (!aliases /.bonaire [/.sint_eustatius /.saba]) - (!aliases /.bosnia [/.herzegovina]) - ... H - (!aliases /.heard_island [/.mcdonald_islands]) - ... S - (!aliases /.saint_helena [/.ascension /.tristan_da_cunha]) - (!aliases /.saint_kitts [/.nevis]) - (!aliases /.saint_pierre [/.miquelon]) - (!aliases /.saint_vincent [/.the_grenadines]) - (!aliases /.sao_tome [/.principe]) - (!aliases /.south_georgia [/.south_sandwich_islands]) - (!aliases /.svalbard [/.jan_mayen]) - ... T - (!aliases /.trinidad [/.tobago]) - (!aliases /.turks [/.caicos_islands]) - ... U - (!aliases /.united_kingdom [/.northern_ireland]) - ... W - (!aliases /.wallis [/.futuna]) - )) - -(def .public random - (Random /.Territory) - (let [options (|> ..territories - (list#each (|>> (the #territories) set.list)) - list.together)] - (do [! random.monad] - [choice (at ! each (n.% (list.size options)) - random.nat)] - (in (maybe.trusted (list.item choice options)))))) - -(def .public test - Test - (<| (_.covering /._) - (_.for [/.Territory]) - (all _.and - (_.for [/.hash] - ($hash.spec /.hash ..random)) - - ..territories_test - ..aliases_test - ))) diff --git a/stdlib/source/test/lux/world.lux b/stdlib/source/test/lux/world.lux index e0018ab8b..0f8c65711 100644 --- a/stdlib/source/test/lux/world.lux +++ b/stdlib/source/test/lux/world.lux @@ -16,7 +16,8 @@ ["[1]/[0]" http ["[1]/[0]" client] ["[1]/[0]" status]]] - ["[1][0]" time]]) + ["[1][0]" time] + ["[1][0]" locale]]) (def .public test Test @@ -30,4 +31,5 @@ /net/http/client.test /net/http/status.test /time.test + /locale.test )) diff --git a/stdlib/source/test/lux/world/locale.lux b/stdlib/source/test/lux/world/locale.lux new file mode 100644 index 000000000..b7c99d34a --- /dev/null +++ b/stdlib/source/test/lux/world/locale.lux @@ -0,0 +1,98 @@ +(.require + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [monad (.only do)] + [\\specification + ["$[0]" equivalence] + ["$[0]" hash]]] + [math + ["[0]" random (.only Random) (.use "[1]#[0]" monad)]] + [data + ["[0]" text (.use "[1]#[0]" equivalence) + ["[0]" encoding (.only Encoding)]] + [collection + ["[0]" list]]]]] + ["[0]" / + ["[1][0]" language] + ["[1][0]" territory]] + [\\library + ["[0]" / (.only) + ["[0]" language (.only Language)] + ["[0]" territory (.only Territory)]]]) + +(def random_language + (Random Language) + (random.either (random#in language.afar) + (random#in language.zaza))) + +(def random_territory + (Random Territory) + (random.either (random#in territory.afghanistan) + (random#in territory.zimbabwe))) + +(def random_encoding + (Random Encoding) + (random.either (random#in encoding.ascii) + (random#in encoding.koi8_u))) + +(def random_locale + (Random /.Locale) + (do random.monad + [language ..random_language + territory ..random_territory + encoding ..random_encoding] + (in (/.locale language {.#Some territory} {.#Some encoding})))) + +(def .public test + Test + (<| (_.covering /._) + (_.for [/.Locale]) + (all _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random_locale)) + (_.for [/.hash] + (do [! random.monad] + [fixed_language ..random_language + fixed_territory ..random_territory + fixed_encoding ..random_encoding] + (all _.and + (|> ..random_language + (at ! each (function (_ language) + (/.locale language {.#Some fixed_territory} {.#Some fixed_encoding}))) + ($hash.spec /.hash)) + (|> ..random_territory + (at ! each (function (_ territory) + (/.locale fixed_language {.#Some territory} {.#Some fixed_encoding}))) + ($hash.spec /.hash)) + (|> ..random_encoding + (at ! each (function (_ encoding) + (/.locale fixed_language {.#Some fixed_territory} {.#Some encoding}))) + ($hash.spec /.hash)) + ))) + + (do random.monad + [language ..random_language + territory ..random_territory + encoding ..random_encoding + .let [l_locale (/.locale language {.#None} {.#None}) + lt_locale (/.locale language {.#Some territory} {.#None}) + le_locale (/.locale language {.#None} {.#Some encoding}) + lte_locale (/.locale language {.#Some territory} {.#Some encoding})] + .let [language_check (and (text#= (language.code language) + (/.code l_locale)) + (list.every? (|>> /.code (text.starts_with? (language.code language))) + (list lt_locale le_locale lte_locale))) + territory_check (list.every? (|>> /.code (text.contains? (territory.long_code territory))) + (list lt_locale lte_locale)) + encoding_check (list.every? (|>> /.code (text.ends_with? (encoding.name encoding))) + (list le_locale lte_locale))]] + (_.coverage [/.locale /.code] + (and language_check + territory_check + encoding_check))) + + /language.test + /territory.test + ))) diff --git a/stdlib/source/test/lux/world/locale/language.lux b/stdlib/source/test/lux/world/locale/language.lux new file mode 100644 index 000000000..edabb90d2 --- /dev/null +++ b/stdlib/source/test/lux/world/locale/language.lux @@ -0,0 +1,301 @@ +(.require + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [monad (.only do)] + [hash (.only Hash)] + [\\specification + ["$[0]" hash]]] + [control + ["[0]" maybe]] + [data + ["[0]" text] + [collection + ["[0]" set (.only Set)] + ["[0]" list (.use "[1]#[0]" functor mix)]]] + [math + ["[0]" random (.only Random)] + [number + ["n" nat]]] + [meta + [macro + ["[0]" template]]]]] + [\\library + ["[0]" /]]) + +(type Bundle + (Record + [#amount Nat + #names (Set Text) + #codes (Set Text) + #languages (Set /.Language) + #test Test])) + +(with_template [ ] + [(def + Bundle + (let [amount (template.amount ) + languages (is (List /.Language) + (`` (list (,, (template.spliced )))))] + [#amount amount + #names (|> languages (list#each /.name) (set.of_list text.hash)) + #codes (|> languages (list#each /.code) (set.of_list text.hash)) + #languages (set.of_list /.hash languages) + #test (_.coverage + true)]))] + + [languages/a [/.afar /.abkhazian /.achinese /.acoli /.adangme + /.adyghe /.afro_asiatic /.afrihili /.afrikaans /.ainu + /.akan /.akkadian /.aleut /.algonquian /.southern_altai + /.amharic /.old_english /.angika /.apache /.arabic + /.official_aramaic /.aragonese /.mapudungun /.arapaho /.artificial + /.arawak /.assamese /.asturian /.athapascan /.australian + /.avaric /.avestan /.awadhi /.aymara /.azerbaijani]] + [languages/b [/.banda /.bamileke /.bashkir /.baluchi /.bambara + /.balinese /.basa /.baltic /.beja /.belarusian + /.bemba /.bengali /.berber /.bhojpuri /.bihari + /.bikol /.bini /.bislama /.siksika /.bantu + /.tibetan /.bosnian /.braj /.breton /.batak + /.buriat /.buginese /.bulgarian /.blin]] + [languages/c [/.caddo /.central_american_indian /.galibi_carib /.catalan /.caucasian + /.cebuano /.celtic /.czech /.chamorro /.chibcha + /.chechen /.chagatai /.chuukese /.mari /.chinook + /.choctaw /.chipewyan /.cherokee /.church_slavic /.chuvash + /.cheyenne /.chamic /.montenegrin /.coptic /.cornish + /.corsican /.creoles_and_pidgins/english /.creoles_and_pidgins/french /.creoles_and_pidgins/portuguese /.cree + /.crimean /.creoles_and_pidgins /.kashubian /.cushitic /.welsh]] + [languages/d [/.dakota /.danish /.dargwa /.land_dayak /.delaware + /.slavey /.dogrib /.dinka /.dhivehi /.dogri + /.dravidian /.lower_sorbian /.duala /.middle_dutch /.dyula + /.dzongkha]] + [languages/e [/.efik /.egyptian /.ekajuk /.greek /.elamite + /.english /.middle_english /.esperanto /.estonian /.basque + /.ewe /.ewondo]] + [languages/f [/.fang /.faroese /.persian /.fanti /.fijian + /.filipino /.finnish /.finno_ugrian /.fon /.french + /.middle_french /.old_french /.northern_frisian /.eastern_frisian /.western_frisian + /.fulah /.friulian]] + [languages/g [/.ga /.gayo /.gbaya /.germanic /.german + /.geez /.gilbertese /.gaelic /.irish /.galician + /.manx /.middle_high_german /.old_high_german /.gondi /.gorontalo + /.gothic /.grebo /.ancient_greek /.guarani /.swiss_german + /.gujarati /.gwich'in]] + [languages/h [/.haida /.haitian /.hausa /.hawaiian /.hebrew + /.herero /.hiligaynon /.himachali /.hindi /.hittite + /.hmong /.hiri_motu /.croatian /.upper_sorbian /.hungarian + /.hupa /.armenian]] + [languages/i [/.iban /.igbo /.ido /.sichuan_yi /.ijo + /.inuktitut /.interlingue /.iloko /.interlingua /.indic + /.indonesian /.indo_european /.ingush /.inupiaq /.iranian + /.iroquoian /.icelandic /.italian]] + [languages/j [/.javanese /.lojban /.japanese /.judeo_persian /.judeo_arabic]] + [languages/k [/.kara_kalpak /.kabyle /.kachin /.kalaallisut /.kamba + /.kannada /.karen /.kashmiri /.georgian /.kanuri + /.kawi /.kazakh /.kabardian /.khasi /.khoisan + /.central_khmer /.khotanese /.gikuyu /.kinyarwanda /.kyrgyz + /.kimbundu /.konkani /.komi /.kongo /.korean + /.kosraean /.kpelle /.karachay_balkar /.karelian /.kru + /.kurukh /.kwanyama /.kumyk /.kurdish /.kutenai]] + [languages/l [/.ladino /.lahnda /.lamba /.lao /.latin + /.latvian /.lezghian /.limburgan /.lingala /.lithuanian + /.mongo /.lozi /.luxembourgish /.luba_lulua /.luba_katanga + /.ganda /.luiseno /.lunda /.luo /.lushai]] + [languages/m [/.madurese /.magahi /.marshallese /.maithili /.makasar + /.malayalam /.mandingo /.austronesian /.marathi /.masai + /.moksha /.mandar /.mende /.middle_irish /.mi'kmaq + /.minangkabau /.macedonian /.mon_khmer /.malagasy /.maltese + /.manchu /.manipuri /.manobo /.mohawk /.mongolian + /.mossi /.maori /.malay /.munda /.creek + /.mirandese /.marwari /.burmese /.mayan /.erzya]] + [languages/n [/.nahuatl /.north_american_indian /.neapolitan /.nauru /.navajo + /.south_ndebele /.north_ndebele /.ndonga /.low_german /.nepali + /.newari /.nias /.niger_kordofanian /.niuean /.dutch + /.nynorsk /.bokmal /.nogai /.old_norse /.norwegian + /.n'ko /.northern_sotho /.nubian /.old_newari /.nyanja + /.nyamwezi /.nyankole /.nyoro /.nzima]] + [languages/o [/.occitan /.ojibwa /.oriya /.oromo /.osage + /.ossetic /.ottoman_turkish /.otomian]] + [languages/p [/.papuan /.pangasinan /.pahlavi /.pampanga /.punjabi + /.papiamento /.palauan /.old_persian /.philippine /.phoenician + /.pali /.polish /.pohnpeian /.portuguese /.prakrit + /.old_provencal /.pashto]] + [languages/q [/.quechua]] + [languages/r [/.rajasthani /.rapanui /.rarotongan /.romance /.romansh + /.romany /.romanian /.rundi /.aromanian /.russian]] + [languages/s0 [/.sandawe /.sango /.yakut /.south_american_indian /.salishan + /.samaritan_aramaic /.sanskrit /.sasak /.santali /.sicilian + /.scots /.selkup /.semitic /.old_irish /.sign + /.shan /.sidamo /.sinhalese /.siouan /.sino_tibetan + /.slavic /.slovak /.slovenian /.southern_sami /.northern_sami + /.sami /.lule /.inari /.samoan /.skolt_sami]] + [languages/s1 [/.shona /.sindhi /.soninke /.sogdian /.somali + /.songhai /.southern_sotho /.spanish /.albanian /.sardinian + /.sranan_tongo /.serbian /.serer /.nilo_saharan /.swati + /.sukuma /.sundanese /.susu /.sumerian /.swahili + /.swedish /.classical_syriac /.syriac]] + [languages/t [/.tahitian /.tai /.tamil /.tatar /.telugu + /.timne /.tereno /.tetum /.tajik /.tagalog + /.thai /.tigre /.tigrinya /.tiv /.tokelau + /.klingon /.tlingit /.tamashek /.tonga /.tongan + /.tok_pisin /.tsimshian /.tswana /.tsonga /.turkmen + /.tumbuka /.tupi /.turkish /.altaic /.tuvalu + /.twi /.tuvinian]] + [languages/u [/.udmurt /.ugaritic /.uyghur /.ukrainian /.umbundu + /.urdu /.uzbek]] + [languages/v [/.vai /.venda /.vietnamese /.volapük /.votic]] + [languages/w [/.wakashan /.walamo /.waray /.washo /.sorbian + /.walloon /.wolof]] + [languages/x [/.kalmyk /.xhosa]] + [languages/y [/.yao /.yapese /.yiddish /.yoruba /.yupik]] + [languages/z [/.zapotec /.blissymbols /.zenaga /.standard_moroccan_tamazight /.zhuang + /.chinese /.zande /.zulu /.zuni /.zaza]] + [languages/etc [/.uncoded /.multiple /.undetermined /.not_applicable]] + ) + +(def languages + (List Bundle) + (list ..languages/a + ..languages/b + ..languages/c + ..languages/d + ..languages/e + ..languages/f + ..languages/g + ..languages/h + ..languages/i + ..languages/j + ..languages/k + ..languages/l + ..languages/m + ..languages/n + ..languages/o + ..languages/p + ..languages/q + ..languages/r + ..languages/s0 + ..languages/s1 + ..languages/t + ..languages/u + ..languages/v + ..languages/w + ..languages/x + ..languages/y + ..languages/z + ..languages/etc + )) + +(def (aggregate lens hash territories) + (All (_ a) (-> (-> Bundle (Set a)) + (Hash a) + (List Bundle) + [Nat (Set a)])) + (list#mix (function (_ bundle [amount set]) + [(n.+ amount (the #amount bundle)) + (set.union set (lens bundle))]) + [0 (set.empty hash)] + territories)) + +(def languages_test + Test + (|> ..languages + list.reversed + (list#each (the #test)) + (list#mix _.and + (`` (all _.and + (,, (with_template [ ] + [(let [[amount set] (..aggregate (the ) ..languages)] + (_.coverage [] + (n.= amount (set.size set))))] + + [/.name #names text.hash] + [/.code #codes text.hash] + [/.equivalence #languages /.hash] + )) + ))))) + +(def !aliases + (template (_ ) + [(_.coverage + (list.every? (at /.equivalence = ) + (`` (list (,, (template.spliced ))))))])) + +(def aliases_test/0 + Test + (all _.and + ... A + (!aliases /.official_aramaic [/.imperial_aramaic]) + (!aliases /.asturian [/.bable /.leonese /.asturleonese]) + ... B + (!aliases /.bini [/.edo]) + (!aliases /.blin [/.bilin]) + ... C + (!aliases /.catalan [/.valencian]) + (!aliases /.church_slavic [/.old_slavonic /.church_slavonic /.old_bulgarian /.old_church_slavonic]) + ... D + (!aliases /.dhivehi [/.maldivian]) + ... G + (!aliases /.swiss_german [/.alemannic /.alsatian]) + ... I + (!aliases /.sichuan_yi [/.nuosu]) + ... K + (!aliases /.kachin [/.jingpho]) + (!aliases /.kalaallisut [/.greenlandic]) + (!aliases /.khotanese [/.sakan]) + )) + +(def aliases_test/1 + Test + (all _.and + ... M + (!aliases /.mi'kmaq [/.micmac]) + ... N + (!aliases /.newari [/.nepal_bhasa]) + (!aliases /.dutch [/.flemish]) + (!aliases /.northern_sotho [/.pedi /.sepedi]) + (!aliases /.old_newari [/.classical_newari /.classical_nepal_bhasa]) + (!aliases /.nyanja [/.chichewa /.chewa]) + ... O + (!aliases /.occitan [/.provencal]) + ... P + (!aliases /.pampanga [/.kapampangan]) + ... R + (!aliases /.rarotongan [/.cook_islands_maori]) + (!aliases /.romanian [/.moldavian /.moldovan]) + (!aliases /.aromanian [/.arumanian /.macedo_romanian]) + ... S + (!aliases /.spanish [/.castilian]) + ... X + (!aliases /.kalmyk [/.oirat]) + ... Z + (!aliases /.zaza [/.dimili /.dimli /.kirdki /.kirmanjki /.zazaki]) + )) + +(def aliases_test + Test + (all _.and + ..aliases_test/0 + ..aliases_test/1 + )) + +(def .public random + (Random /.Language) + (let [options (|> ..languages + (list#each (|>> (the #languages) set.list)) + list.together)] + (do [! random.monad] + [choice (at ! each (n.% (list.size options)) + random.nat)] + (in (maybe.trusted (list.item choice options)))))) + +(def .public test + Test + (<| (_.covering /._) + (_.for [/.Language]) + (all _.and + (_.for [/.hash] + ($hash.spec /.hash ..random)) + + ..languages_test + ..aliases_test + ))) diff --git a/stdlib/source/test/lux/world/locale/territory.lux b/stdlib/source/test/lux/world/locale/territory.lux new file mode 100644 index 000000000..969fe32a1 --- /dev/null +++ b/stdlib/source/test/lux/world/locale/territory.lux @@ -0,0 +1,227 @@ +(.require + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [monad (.only do)] + [hash (.only Hash)] + [\\specification + ["$[0]" hash]]] + [control + ["[0]" maybe]] + [data + ["[0]" text] + [collection + ["[0]" set (.only Set)] + ["[0]" list (.use "[1]#[0]" functor mix)]]] + [math + ["[0]" random (.only Random)] + [number + ["n" nat]]] + [meta + [macro + ["[0]" template]]]]] + [\\library + ["[0]" /]]) + +(type Bundle + (Record + [#amount Nat + #names (Set Text) + #shorts (Set Text) + #longs (Set Text) + #numbers (Set Nat) + #territories (Set /.Territory) + #test Test])) + +(with_template [ ] + [(def + Bundle + (let [amount (template.amount ) + territories (`` (list (,, (template.spliced ))))] + [#amount amount + #names (|> territories (list#each /.name) (set.of_list text.hash)) + #shorts (|> territories (list#each /.short_code) (set.of_list text.hash)) + #longs (|> territories (list#each /.long_code) (set.of_list text.hash)) + #numbers (|> territories (list#each /.numeric_code) (set.of_list n.hash)) + #territories (|> territories (set.of_list /.hash)) + #test (_.coverage + true)]))] + + [territories/a [/.afghanistan /.aland_islands /.albania /.algeria /.american_samoa + /.andorra /.angola /.anguilla /.antarctica /.antigua + /.argentina /.armenia /.aruba /.australia /.austria + /.azerbaijan]] + [territories/b [/.the_bahamas /.bahrain /.bangladesh /.barbados /.belarus + /.belgium /.belize /.benin /.bermuda /.bhutan + /.bolivia /.bonaire /.bosnia /.botswana /.bouvet_island + /.brazil /.british_indian_ocean_territory /.brunei_darussalam /.bulgaria /.burkina_faso + /.burundi]] + [territories/c [/.cape_verde /.cambodia /.cameroon /.canada /.cayman_islands + /.central_african_republic /.chad /.chile /.china /.christmas_island + /.cocos_islands /.colombia /.comoros /.congo /.democratic_republic_of_the_congo + /.cook_islands /.costa_rica /.ivory_coast /.croatia /.cuba + /.curacao /.cyprus /.czech_republic]] + [territories/d [/.denmark /.djibouti /.dominica /.dominican_republic]] + [territories/e [/.ecuador /.egypt /.el_salvador /.equatorial_guinea /.eritrea + /.estonia /.eswatini /.ethiopia]] + [territories/f [/.falkland_islands /.faroe_islands /.fiji /.finland /.france + /.french_guiana /.french_polynesia /.french_southern_territories]] + [territories/g [/.gabon /.the_gambia /.georgia /.germany /.ghana + /.gibraltar /.greece /.greenland /.grenada /.guadeloupe + /.guam /.guatemala /.guernsey /.guinea /.guinea_bissau + /.guyana]] + [territories/h [/.haiti /.heard_island /.honduras /.hong_kong + /.hungary]] + [territories/i [/.iceland /.india /.indonesia /.iran /.iraq + /.ireland /.isle_of_man /.israel /.italy]] + [territories/j [/.jamaica /.japan /.jersey /.jordan]] + [territories/k [/.kazakhstan /.kenya /.kiribati /.north_korea /.south_korea + /.kuwait /.kyrgyzstan]] + [territories/l [/.laos /.latvia /.lebanon /.lesotho /.liberia + /.libya /.liechtenstein /.lithuania /.luxembourg]] + [territories/m [/.macau /.macedonia /.madagascar /.malawi /.malaysia + /.maldives /.mali /.malta /.marshall_islands /.martinique + /.mauritania /.mauritius /.mayotte /.mexico /.micronesia + /.moldova /.monaco /.mongolia /.montenegro /.montserrat + /.morocco /.mozambique /.myanmar]] + [territories/n [/.namibia /.nauru /.nepal /.netherlands /.new_caledonia + /.new_zealand /.nicaragua /.niger /.nigeria /.niue + /.norfolk_island /.northern_mariana_islands /.norway]] + [territories/o [/.oman]] + [territories/p [/.pakistan /.palau /.palestine /.panama /.papua_new_guinea + /.paraguay /.peru /.philippines /.pitcairn_islands /.poland + /.portugal /.puerto_rico]] + [territories/q [/.qatar]] + [territories/r [/.reunion /.romania /.russia /.rwanda]] + [territories/s [/.saint_barthelemy /.saint_helena /.saint_kitts /.saint_lucia /.saint_martin + /.saint_pierre /.saint_vincent /.samoa /.san_marino /.sao_tome + /.saudi_arabia /.senegal /.serbia /.seychelles /.sierra_leone + /.singapore /.sint_maarten /.slovakia /.slovenia /.solomon_islands + /.somalia /.south_africa /.south_georgia /.south_sudan /.spain + /.sri_lanka /.sudan /.suriname /.svalbard /.sweden + /.switzerland /.syria]] + [territories/t [/.taiwan /.tajikistan /.tanzania /.thailand /.east_timor + /.togo /.tokelau /.tonga /.trinidad /.tunisia + /.turkey /.turkmenistan /.turks /.tuvalu]] + [territories/u [/.uganda /.ukraine /.united_arab_emirates /.united_kingdom /.united_states_of_america + /.united_states_minor_outlying_islands /.uruguay /.uzbekistan]] + [territories/v [/.vanuatu /.vatican_city /.venezuela /.vietnam /.british_virgin_islands /.united_states_virgin_islands]] + [territories/w [/.wallis /.western_sahara]] + [territories/y [/.yemen]] + [territories/z [/.zambia /.zimbabwe]] + ) + +(def territories + (List Bundle) + (list ..territories/a + ..territories/b + ..territories/c + ..territories/d + ..territories/e + ..territories/f + ..territories/g + ..territories/h + ..territories/i + ..territories/j + ..territories/k + ..territories/l + ..territories/m + ..territories/n + ..territories/o + ..territories/p + ..territories/q + ..territories/r + ..territories/s + ..territories/t + ..territories/u + ..territories/v + ..territories/w + ..territories/y + ..territories/z)) + +(def (aggregate lens hash territories) + (All (_ a) (-> (-> Bundle (Set a)) + (Hash a) + (List Bundle) + [Nat (Set a)])) + (list#mix (function (_ bundle [amount set]) + [(n.+ amount (the #amount bundle)) + (set.union set (lens bundle))]) + [0 (set.empty hash)] + territories)) + +(def territories_test + Test + (|> ..territories + list.reversed + (list#each (the #test)) + (list#mix _.and + (`` (all _.and + (,, (with_template [ ] + [(let [[amount set] (..aggregate (the ) ..territories)] + (_.coverage [] + (n.= amount (set.size set))))] + + [/.name #names text.hash] + [/.short_code #shorts text.hash] + [/.long_code #longs text.hash] + [/.numeric_code #numbers n.hash] + [/.equivalence #territories /.hash] + )) + ))))) + +(def !aliases + (template (_ ) + [(_.coverage + (list.every? (at /.equivalence = ) + (`` (list (,, (template.spliced ))))))])) + +(def aliases_test + Test + (all _.and + ... A + (!aliases /.antigua [/.barbuda]) + ... B + (!aliases /.bonaire [/.sint_eustatius /.saba]) + (!aliases /.bosnia [/.herzegovina]) + ... H + (!aliases /.heard_island [/.mcdonald_islands]) + ... S + (!aliases /.saint_helena [/.ascension /.tristan_da_cunha]) + (!aliases /.saint_kitts [/.nevis]) + (!aliases /.saint_pierre [/.miquelon]) + (!aliases /.saint_vincent [/.the_grenadines]) + (!aliases /.sao_tome [/.principe]) + (!aliases /.south_georgia [/.south_sandwich_islands]) + (!aliases /.svalbard [/.jan_mayen]) + ... T + (!aliases /.trinidad [/.tobago]) + (!aliases /.turks [/.caicos_islands]) + ... U + (!aliases /.united_kingdom [/.northern_ireland]) + ... W + (!aliases /.wallis [/.futuna]) + )) + +(def .public random + (Random /.Territory) + (let [options (|> ..territories + (list#each (|>> (the #territories) set.list)) + list.together)] + (do [! random.monad] + [choice (at ! each (n.% (list.size options)) + random.nat)] + (in (maybe.trusted (list.item choice options)))))) + +(def .public test + Test + (<| (_.covering /._) + (_.for [/.Territory]) + (all _.and + (_.for [/.hash] + ($hash.spec /.hash ..random)) + + ..territories_test + ..aliases_test + ))) -- cgit v1.2.3