···11+## 0.1.0 (2022-08-27) Cambridge
22+33+- Initial public release
+31
vendor/opam/ISO3166/ISO3166.opam
···11+opam-version: "2.0"
22+synopsis: "OCaml library for working with ISO3166"
33+description: "This OCaml library provides an interface to the ISO3166 standard (a.k.a country codes)"
44+maintainer: ["patrick@sirref.org"]
55+authors: ["Patrick Ferris"]
66+license: "MIT"
77+homepage: "https://github.com/geocaml/iso3166"
88+bug-reports: "https://github.com/geocaml/iso3166/issues"
99+depends: [
1010+ "ocaml" {>= "4.03"}
1111+ "dune" {>= "2.9"}
1212+ "mdx" {with-test}
1313+ "odoc" {with-doc}
1414+]
1515+build: [
1616+ ["dune" "subst"] {dev}
1717+ [
1818+ "dune"
1919+ "build"
2020+ "-p"
2121+ name
2222+ "-j"
2323+ jobs
2424+ "--promote-install-files=false"
2525+ "@install"
2626+ "@runtest" {with-test}
2727+ "@doc" {with-doc}
2828+ ]
2929+ ["dune" "install" "-p" name "--create-install-files" name]
3030+]
3131+dev-repo: "git+https://github.com/geocaml/iso3166.git"
+28
vendor/opam/ISO3166/LICENSE.md
···11+# OCaml Source Code
22+33+The MIT License
44+55+Copyright (c) 2022 Patrick Ferris <patrick@sirref.org>
66+77+Permission is hereby granted, free of charge, to any person obtaining a copy
88+of this software and associated documentation files (the "Software"), to deal
99+in the Software without restriction, including without limitation the rights
1010+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1111+copies of the Software, and to permit persons to whom the Software is
1212+furnished to do so, subject to the following conditions:
1313+1414+The above copyright notice and this permission notice shall be included in
1515+all copies or substantial portions of the Software.
1616+1717+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1818+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1919+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2020+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2121+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323+THE SOFTWARE.
2424+2525+# Data
2626+2727+
2828+This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
+33
vendor/opam/ISO3166/README.md
···11+OCaml ISO3166
22+-------------
33+44+This library provides a pure OCaml interface to working with the ISO 3166 standard (a.k.a country codes).
55+66+```ocaml
77+# ISO3166.alpha3_to_country `IRL |> ISO3166.Country.name;;
88+- : string = "Ireland"
99+```
1010+1111+The `Country` module already contains all of the countries for convenience named after the alpha2 country code.
1212+1313+```ocaml
1414+# ISO3166.Country.fr |> ISO3166.Country.name;;
1515+- : string = "France"
1616+# ISO3166.Country.fr |> ISO3166.Country.numeric |> ISO3166.numeric_to_string;;
1717+- : string = "250"
1818+```
1919+2020+The original use-case for this library was to encode the conversion from alpha2 country codes to strings. Lots of public APIs that provide country-specific information use ISO3166 to distinguish between countries.
2121+2222+```ocaml
2323+# ISO3166.alpha2_to_string `ES;;
2424+- : string = "ES"
2525+```
2626+2727+## Data Source
2828+2929+The data that generates the OCaml file comes from https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/commit/6741ae83a08ce1802d22849db0a944d99e254bae which has the following disclaimer which applies to this library too.
3030+3131+> Please check the data independently for accuracy before using it in any system and for any purpose
3232+>
3333+> Although I've tried to ensure the data is as accurate as possible, the data is not authoritative, and so should not be considered accurate
···11+name,alpha-2,alpha-3,country-code,iso_3166-2,region,sub-region,intermediate-region,region-code,sub-region-code,intermediate-region-code
22+Afghanistan,AF,AFG,004,ISO 3166-2:AF,Asia,Southern Asia,"",142,034,""
33+Åland Islands,AX,ALA,248,ISO 3166-2:AX,Europe,Northern Europe,"",150,154,""
44+Albania,AL,ALB,008,ISO 3166-2:AL,Europe,Southern Europe,"",150,039,""
55+Algeria,DZ,DZA,012,ISO 3166-2:DZ,Africa,Northern Africa,"",002,015,""
66+American Samoa,AS,ASM,016,ISO 3166-2:AS,Oceania,Polynesia,"",009,061,""
77+Andorra,AD,AND,020,ISO 3166-2:AD,Europe,Southern Europe,"",150,039,""
88+Angola,AO,AGO,024,ISO 3166-2:AO,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
99+Anguilla,AI,AIA,660,ISO 3166-2:AI,Americas,Latin America and the Caribbean,Caribbean,019,419,029
1010+Antarctica,AQ,ATA,010,ISO 3166-2:AQ,"","","","","",""
1111+Antigua and Barbuda,AG,ATG,028,ISO 3166-2:AG,Americas,Latin America and the Caribbean,Caribbean,019,419,029
1212+Argentina,AR,ARG,032,ISO 3166-2:AR,Americas,Latin America and the Caribbean,South America,019,419,005
1313+Armenia,AM,ARM,051,ISO 3166-2:AM,Asia,Western Asia,"",142,145,""
1414+Aruba,AW,ABW,533,ISO 3166-2:AW,Americas,Latin America and the Caribbean,Caribbean,019,419,029
1515+Australia,AU,AUS,036,ISO 3166-2:AU,Oceania,Australia and New Zealand,"",009,053,""
1616+Austria,AT,AUT,040,ISO 3166-2:AT,Europe,Western Europe,"",150,155,""
1717+Azerbaijan,AZ,AZE,031,ISO 3166-2:AZ,Asia,Western Asia,"",142,145,""
1818+Bahamas,BS,BHS,044,ISO 3166-2:BS,Americas,Latin America and the Caribbean,Caribbean,019,419,029
1919+Bahrain,BH,BHR,048,ISO 3166-2:BH,Asia,Western Asia,"",142,145,""
2020+Bangladesh,BD,BGD,050,ISO 3166-2:BD,Asia,Southern Asia,"",142,034,""
2121+Barbados,BB,BRB,052,ISO 3166-2:BB,Americas,Latin America and the Caribbean,Caribbean,019,419,029
2222+Belarus,BY,BLR,112,ISO 3166-2:BY,Europe,Eastern Europe,"",150,151,""
2323+Belgium,BE,BEL,056,ISO 3166-2:BE,Europe,Western Europe,"",150,155,""
2424+Belize,BZ,BLZ,084,ISO 3166-2:BZ,Americas,Latin America and the Caribbean,Central America,019,419,013
2525+Benin,BJ,BEN,204,ISO 3166-2:BJ,Africa,Sub-Saharan Africa,Western Africa,002,202,011
2626+Bermuda,BM,BMU,060,ISO 3166-2:BM,Americas,Northern America,"",019,021,""
2727+Bhutan,BT,BTN,064,ISO 3166-2:BT,Asia,Southern Asia,"",142,034,""
2828+Bolivia (Plurinational State of),BO,BOL,068,ISO 3166-2:BO,Americas,Latin America and the Caribbean,South America,019,419,005
2929+"Bonaire, Sint Eustatius and Saba",BQ,BES,535,ISO 3166-2:BQ,Americas,Latin America and the Caribbean,Caribbean,019,419,029
3030+Bosnia and Herzegovina,BA,BIH,070,ISO 3166-2:BA,Europe,Southern Europe,"",150,039,""
3131+Botswana,BW,BWA,072,ISO 3166-2:BW,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
3232+Bouvet Island,BV,BVT,074,ISO 3166-2:BV,Americas,Latin America and the Caribbean,South America,019,419,005
3333+Brazil,BR,BRA,076,ISO 3166-2:BR,Americas,Latin America and the Caribbean,South America,019,419,005
3434+British Indian Ocean Territory,IO,IOT,086,ISO 3166-2:IO,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
3535+Brunei Darussalam,BN,BRN,096,ISO 3166-2:BN,Asia,South-eastern Asia,"",142,035,""
3636+Bulgaria,BG,BGR,100,ISO 3166-2:BG,Europe,Eastern Europe,"",150,151,""
3737+Burkina Faso,BF,BFA,854,ISO 3166-2:BF,Africa,Sub-Saharan Africa,Western Africa,002,202,011
3838+Burundi,BI,BDI,108,ISO 3166-2:BI,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
3939+Cabo Verde,CV,CPV,132,ISO 3166-2:CV,Africa,Sub-Saharan Africa,Western Africa,002,202,011
4040+Cambodia,KH,KHM,116,ISO 3166-2:KH,Asia,South-eastern Asia,"",142,035,""
4141+Cameroon,CM,CMR,120,ISO 3166-2:CM,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
4242+Canada,CA,CAN,124,ISO 3166-2:CA,Americas,Northern America,"",019,021,""
4343+Cayman Islands,KY,CYM,136,ISO 3166-2:KY,Americas,Latin America and the Caribbean,Caribbean,019,419,029
4444+Central African Republic,CF,CAF,140,ISO 3166-2:CF,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
4545+Chad,TD,TCD,148,ISO 3166-2:TD,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
4646+Chile,CL,CHL,152,ISO 3166-2:CL,Americas,Latin America and the Caribbean,South America,019,419,005
4747+China,CN,CHN,156,ISO 3166-2:CN,Asia,Eastern Asia,"",142,030,""
4848+Christmas Island,CX,CXR,162,ISO 3166-2:CX,Oceania,Australia and New Zealand,"",009,053,""
4949+Cocos (Keeling) Islands,CC,CCK,166,ISO 3166-2:CC,Oceania,Australia and New Zealand,"",009,053,""
5050+Colombia,CO,COL,170,ISO 3166-2:CO,Americas,Latin America and the Caribbean,South America,019,419,005
5151+Comoros,KM,COM,174,ISO 3166-2:KM,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
5252+Congo,CG,COG,178,ISO 3166-2:CG,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
5353+"Congo, Democratic Republic of the",CD,COD,180,ISO 3166-2:CD,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
5454+Cook Islands,CK,COK,184,ISO 3166-2:CK,Oceania,Polynesia,"",009,061,""
5555+Costa Rica,CR,CRI,188,ISO 3166-2:CR,Americas,Latin America and the Caribbean,Central America,019,419,013
5656+Côte d'Ivoire,CI,CIV,384,ISO 3166-2:CI,Africa,Sub-Saharan Africa,Western Africa,002,202,011
5757+Croatia,HR,HRV,191,ISO 3166-2:HR,Europe,Southern Europe,"",150,039,""
5858+Cuba,CU,CUB,192,ISO 3166-2:CU,Americas,Latin America and the Caribbean,Caribbean,019,419,029
5959+Curaçao,CW,CUW,531,ISO 3166-2:CW,Americas,Latin America and the Caribbean,Caribbean,019,419,029
6060+Cyprus,CY,CYP,196,ISO 3166-2:CY,Asia,Western Asia,"",142,145,""
6161+Czechia,CZ,CZE,203,ISO 3166-2:CZ,Europe,Eastern Europe,"",150,151,""
6262+Denmark,DK,DNK,208,ISO 3166-2:DK,Europe,Northern Europe,"",150,154,""
6363+Djibouti,DJ,DJI,262,ISO 3166-2:DJ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
6464+Dominica,DM,DMA,212,ISO 3166-2:DM,Americas,Latin America and the Caribbean,Caribbean,019,419,029
6565+Dominican Republic,DO,DOM,214,ISO 3166-2:DO,Americas,Latin America and the Caribbean,Caribbean,019,419,029
6666+Ecuador,EC,ECU,218,ISO 3166-2:EC,Americas,Latin America and the Caribbean,South America,019,419,005
6767+Egypt,EG,EGY,818,ISO 3166-2:EG,Africa,Northern Africa,"",002,015,""
6868+El Salvador,SV,SLV,222,ISO 3166-2:SV,Americas,Latin America and the Caribbean,Central America,019,419,013
6969+Equatorial Guinea,GQ,GNQ,226,ISO 3166-2:GQ,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
7070+Eritrea,ER,ERI,232,ISO 3166-2:ER,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
7171+Estonia,EE,EST,233,ISO 3166-2:EE,Europe,Northern Europe,"",150,154,""
7272+Eswatini,SZ,SWZ,748,ISO 3166-2:SZ,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
7373+Ethiopia,ET,ETH,231,ISO 3166-2:ET,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
7474+Falkland Islands (Malvinas),FK,FLK,238,ISO 3166-2:FK,Americas,Latin America and the Caribbean,South America,019,419,005
7575+Faroe Islands,FO,FRO,234,ISO 3166-2:FO,Europe,Northern Europe,"",150,154,""
7676+Fiji,FJ,FJI,242,ISO 3166-2:FJ,Oceania,Melanesia,"",009,054,""
7777+Finland,FI,FIN,246,ISO 3166-2:FI,Europe,Northern Europe,"",150,154,""
7878+France,FR,FRA,250,ISO 3166-2:FR,Europe,Western Europe,"",150,155,""
7979+French Guiana,GF,GUF,254,ISO 3166-2:GF,Americas,Latin America and the Caribbean,South America,019,419,005
8080+French Polynesia,PF,PYF,258,ISO 3166-2:PF,Oceania,Polynesia,"",009,061,""
8181+French Southern Territories,TF,ATF,260,ISO 3166-2:TF,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
8282+Gabon,GA,GAB,266,ISO 3166-2:GA,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
8383+Gambia,GM,GMB,270,ISO 3166-2:GM,Africa,Sub-Saharan Africa,Western Africa,002,202,011
8484+Georgia,GE,GEO,268,ISO 3166-2:GE,Asia,Western Asia,"",142,145,""
8585+Germany,DE,DEU,276,ISO 3166-2:DE,Europe,Western Europe,"",150,155,""
8686+Ghana,GH,GHA,288,ISO 3166-2:GH,Africa,Sub-Saharan Africa,Western Africa,002,202,011
8787+Gibraltar,GI,GIB,292,ISO 3166-2:GI,Europe,Southern Europe,"",150,039,""
8888+Greece,GR,GRC,300,ISO 3166-2:GR,Europe,Southern Europe,"",150,039,""
8989+Greenland,GL,GRL,304,ISO 3166-2:GL,Americas,Northern America,"",019,021,""
9090+Grenada,GD,GRD,308,ISO 3166-2:GD,Americas,Latin America and the Caribbean,Caribbean,019,419,029
9191+Guadeloupe,GP,GLP,312,ISO 3166-2:GP,Americas,Latin America and the Caribbean,Caribbean,019,419,029
9292+Guam,GU,GUM,316,ISO 3166-2:GU,Oceania,Micronesia,"",009,057,""
9393+Guatemala,GT,GTM,320,ISO 3166-2:GT,Americas,Latin America and the Caribbean,Central America,019,419,013
9494+Guernsey,GG,GGY,831,ISO 3166-2:GG,Europe,Northern Europe,Channel Islands,150,154,830
9595+Guinea,GN,GIN,324,ISO 3166-2:GN,Africa,Sub-Saharan Africa,Western Africa,002,202,011
9696+Guinea-Bissau,GW,GNB,624,ISO 3166-2:GW,Africa,Sub-Saharan Africa,Western Africa,002,202,011
9797+Guyana,GY,GUY,328,ISO 3166-2:GY,Americas,Latin America and the Caribbean,South America,019,419,005
9898+Haiti,HT,HTI,332,ISO 3166-2:HT,Americas,Latin America and the Caribbean,Caribbean,019,419,029
9999+Heard Island and McDonald Islands,HM,HMD,334,ISO 3166-2:HM,Oceania,Australia and New Zealand,"",009,053,""
100100+Holy See,VA,VAT,336,ISO 3166-2:VA,Europe,Southern Europe,"",150,039,""
101101+Honduras,HN,HND,340,ISO 3166-2:HN,Americas,Latin America and the Caribbean,Central America,019,419,013
102102+Hong Kong,HK,HKG,344,ISO 3166-2:HK,Asia,Eastern Asia,"",142,030,""
103103+Hungary,HU,HUN,348,ISO 3166-2:HU,Europe,Eastern Europe,"",150,151,""
104104+Iceland,IS,ISL,352,ISO 3166-2:IS,Europe,Northern Europe,"",150,154,""
105105+India,IN,IND,356,ISO 3166-2:IN,Asia,Southern Asia,"",142,034,""
106106+Indonesia,ID,IDN,360,ISO 3166-2:ID,Asia,South-eastern Asia,"",142,035,""
107107+Iran (Islamic Republic of),IR,IRN,364,ISO 3166-2:IR,Asia,Southern Asia,"",142,034,""
108108+Iraq,IQ,IRQ,368,ISO 3166-2:IQ,Asia,Western Asia,"",142,145,""
109109+Ireland,IE,IRL,372,ISO 3166-2:IE,Europe,Northern Europe,"",150,154,""
110110+Isle of Man,IM,IMN,833,ISO 3166-2:IM,Europe,Northern Europe,"",150,154,""
111111+Israel,IL,ISR,376,ISO 3166-2:IL,Asia,Western Asia,"",142,145,""
112112+Italy,IT,ITA,380,ISO 3166-2:IT,Europe,Southern Europe,"",150,039,""
113113+Jamaica,JM,JAM,388,ISO 3166-2:JM,Americas,Latin America and the Caribbean,Caribbean,019,419,029
114114+Japan,JP,JPN,392,ISO 3166-2:JP,Asia,Eastern Asia,"",142,030,""
115115+Jersey,JE,JEY,832,ISO 3166-2:JE,Europe,Northern Europe,Channel Islands,150,154,830
116116+Jordan,JO,JOR,400,ISO 3166-2:JO,Asia,Western Asia,"",142,145,""
117117+Kazakhstan,KZ,KAZ,398,ISO 3166-2:KZ,Asia,Central Asia,"",142,143,""
118118+Kenya,KE,KEN,404,ISO 3166-2:KE,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
119119+Kiribati,KI,KIR,296,ISO 3166-2:KI,Oceania,Micronesia,"",009,057,""
120120+Korea (Democratic People's Republic of),KP,PRK,408,ISO 3166-2:KP,Asia,Eastern Asia,"",142,030,""
121121+"Korea, Republic of",KR,KOR,410,ISO 3166-2:KR,Asia,Eastern Asia,"",142,030,""
122122+Kuwait,KW,KWT,414,ISO 3166-2:KW,Asia,Western Asia,"",142,145,""
123123+Kyrgyzstan,KG,KGZ,417,ISO 3166-2:KG,Asia,Central Asia,"",142,143,""
124124+Lao People's Democratic Republic,LA,LAO,418,ISO 3166-2:LA,Asia,South-eastern Asia,"",142,035,""
125125+Latvia,LV,LVA,428,ISO 3166-2:LV,Europe,Northern Europe,"",150,154,""
126126+Lebanon,LB,LBN,422,ISO 3166-2:LB,Asia,Western Asia,"",142,145,""
127127+Lesotho,LS,LSO,426,ISO 3166-2:LS,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
128128+Liberia,LR,LBR,430,ISO 3166-2:LR,Africa,Sub-Saharan Africa,Western Africa,002,202,011
129129+Libya,LY,LBY,434,ISO 3166-2:LY,Africa,Northern Africa,"",002,015,""
130130+Liechtenstein,LI,LIE,438,ISO 3166-2:LI,Europe,Western Europe,"",150,155,""
131131+Lithuania,LT,LTU,440,ISO 3166-2:LT,Europe,Northern Europe,"",150,154,""
132132+Luxembourg,LU,LUX,442,ISO 3166-2:LU,Europe,Western Europe,"",150,155,""
133133+Macao,MO,MAC,446,ISO 3166-2:MO,Asia,Eastern Asia,"",142,030,""
134134+Madagascar,MG,MDG,450,ISO 3166-2:MG,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
135135+Malawi,MW,MWI,454,ISO 3166-2:MW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
136136+Malaysia,MY,MYS,458,ISO 3166-2:MY,Asia,South-eastern Asia,"",142,035,""
137137+Maldives,MV,MDV,462,ISO 3166-2:MV,Asia,Southern Asia,"",142,034,""
138138+Mali,ML,MLI,466,ISO 3166-2:ML,Africa,Sub-Saharan Africa,Western Africa,002,202,011
139139+Malta,MT,MLT,470,ISO 3166-2:MT,Europe,Southern Europe,"",150,039,""
140140+Marshall Islands,MH,MHL,584,ISO 3166-2:MH,Oceania,Micronesia,"",009,057,""
141141+Martinique,MQ,MTQ,474,ISO 3166-2:MQ,Americas,Latin America and the Caribbean,Caribbean,019,419,029
142142+Mauritania,MR,MRT,478,ISO 3166-2:MR,Africa,Sub-Saharan Africa,Western Africa,002,202,011
143143+Mauritius,MU,MUS,480,ISO 3166-2:MU,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
144144+Mayotte,YT,MYT,175,ISO 3166-2:YT,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
145145+Mexico,MX,MEX,484,ISO 3166-2:MX,Americas,Latin America and the Caribbean,Central America,019,419,013
146146+Micronesia (Federated States of),FM,FSM,583,ISO 3166-2:FM,Oceania,Micronesia,"",009,057,""
147147+"Moldova, Republic of",MD,MDA,498,ISO 3166-2:MD,Europe,Eastern Europe,"",150,151,""
148148+Monaco,MC,MCO,492,ISO 3166-2:MC,Europe,Western Europe,"",150,155,""
149149+Mongolia,MN,MNG,496,ISO 3166-2:MN,Asia,Eastern Asia,"",142,030,""
150150+Montenegro,ME,MNE,499,ISO 3166-2:ME,Europe,Southern Europe,"",150,039,""
151151+Montserrat,MS,MSR,500,ISO 3166-2:MS,Americas,Latin America and the Caribbean,Caribbean,019,419,029
152152+Morocco,MA,MAR,504,ISO 3166-2:MA,Africa,Northern Africa,"",002,015,""
153153+Mozambique,MZ,MOZ,508,ISO 3166-2:MZ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
154154+Myanmar,MM,MMR,104,ISO 3166-2:MM,Asia,South-eastern Asia,"",142,035,""
155155+Namibia,NA,NAM,516,ISO 3166-2:NA,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
156156+Nauru,NR,NRU,520,ISO 3166-2:NR,Oceania,Micronesia,"",009,057,""
157157+Nepal,NP,NPL,524,ISO 3166-2:NP,Asia,Southern Asia,"",142,034,""
158158+Netherlands,NL,NLD,528,ISO 3166-2:NL,Europe,Western Europe,"",150,155,""
159159+New Caledonia,NC,NCL,540,ISO 3166-2:NC,Oceania,Melanesia,"",009,054,""
160160+New Zealand,NZ,NZL,554,ISO 3166-2:NZ,Oceania,Australia and New Zealand,"",009,053,""
161161+Nicaragua,NI,NIC,558,ISO 3166-2:NI,Americas,Latin America and the Caribbean,Central America,019,419,013
162162+Niger,NE,NER,562,ISO 3166-2:NE,Africa,Sub-Saharan Africa,Western Africa,002,202,011
163163+Nigeria,NG,NGA,566,ISO 3166-2:NG,Africa,Sub-Saharan Africa,Western Africa,002,202,011
164164+Niue,NU,NIU,570,ISO 3166-2:NU,Oceania,Polynesia,"",009,061,""
165165+Norfolk Island,NF,NFK,574,ISO 3166-2:NF,Oceania,Australia and New Zealand,"",009,053,""
166166+North Macedonia,MK,MKD,807,ISO 3166-2:MK,Europe,Southern Europe,"",150,039,""
167167+Northern Mariana Islands,MP,MNP,580,ISO 3166-2:MP,Oceania,Micronesia,"",009,057,""
168168+Norway,NO,NOR,578,ISO 3166-2:NO,Europe,Northern Europe,"",150,154,""
169169+Oman,OM,OMN,512,ISO 3166-2:OM,Asia,Western Asia,"",142,145,""
170170+Pakistan,PK,PAK,586,ISO 3166-2:PK,Asia,Southern Asia,"",142,034,""
171171+Palau,PW,PLW,585,ISO 3166-2:PW,Oceania,Micronesia,"",009,057,""
172172+"Palestine, State of",PS,PSE,275,ISO 3166-2:PS,Asia,Western Asia,"",142,145,""
173173+Panama,PA,PAN,591,ISO 3166-2:PA,Americas,Latin America and the Caribbean,Central America,019,419,013
174174+Papua New Guinea,PG,PNG,598,ISO 3166-2:PG,Oceania,Melanesia,"",009,054,""
175175+Paraguay,PY,PRY,600,ISO 3166-2:PY,Americas,Latin America and the Caribbean,South America,019,419,005
176176+Peru,PE,PER,604,ISO 3166-2:PE,Americas,Latin America and the Caribbean,South America,019,419,005
177177+Philippines,PH,PHL,608,ISO 3166-2:PH,Asia,South-eastern Asia,"",142,035,""
178178+Pitcairn,PN,PCN,612,ISO 3166-2:PN,Oceania,Polynesia,"",009,061,""
179179+Poland,PL,POL,616,ISO 3166-2:PL,Europe,Eastern Europe,"",150,151,""
180180+Portugal,PT,PRT,620,ISO 3166-2:PT,Europe,Southern Europe,"",150,039,""
181181+Puerto Rico,PR,PRI,630,ISO 3166-2:PR,Americas,Latin America and the Caribbean,Caribbean,019,419,029
182182+Qatar,QA,QAT,634,ISO 3166-2:QA,Asia,Western Asia,"",142,145,""
183183+Réunion,RE,REU,638,ISO 3166-2:RE,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
184184+Romania,RO,ROU,642,ISO 3166-2:RO,Europe,Eastern Europe,"",150,151,""
185185+Russian Federation,RU,RUS,643,ISO 3166-2:RU,Europe,Eastern Europe,"",150,151,""
186186+Rwanda,RW,RWA,646,ISO 3166-2:RW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
187187+Saint Barthélemy,BL,BLM,652,ISO 3166-2:BL,Americas,Latin America and the Caribbean,Caribbean,019,419,029
188188+"Saint Helena, Ascension and Tristan da Cunha",SH,SHN,654,ISO 3166-2:SH,Africa,Sub-Saharan Africa,Western Africa,002,202,011
189189+Saint Kitts and Nevis,KN,KNA,659,ISO 3166-2:KN,Americas,Latin America and the Caribbean,Caribbean,019,419,029
190190+Saint Lucia,LC,LCA,662,ISO 3166-2:LC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
191191+Saint Martin (French part),MF,MAF,663,ISO 3166-2:MF,Americas,Latin America and the Caribbean,Caribbean,019,419,029
192192+Saint Pierre and Miquelon,PM,SPM,666,ISO 3166-2:PM,Americas,Northern America,"",019,021,""
193193+Saint Vincent and the Grenadines,VC,VCT,670,ISO 3166-2:VC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
194194+Samoa,WS,WSM,882,ISO 3166-2:WS,Oceania,Polynesia,"",009,061,""
195195+San Marino,SM,SMR,674,ISO 3166-2:SM,Europe,Southern Europe,"",150,039,""
196196+Sao Tome and Principe,ST,STP,678,ISO 3166-2:ST,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
197197+Saudi Arabia,SA,SAU,682,ISO 3166-2:SA,Asia,Western Asia,"",142,145,""
198198+Senegal,SN,SEN,686,ISO 3166-2:SN,Africa,Sub-Saharan Africa,Western Africa,002,202,011
199199+Serbia,RS,SRB,688,ISO 3166-2:RS,Europe,Southern Europe,"",150,039,""
200200+Seychelles,SC,SYC,690,ISO 3166-2:SC,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
201201+Sierra Leone,SL,SLE,694,ISO 3166-2:SL,Africa,Sub-Saharan Africa,Western Africa,002,202,011
202202+Singapore,SG,SGP,702,ISO 3166-2:SG,Asia,South-eastern Asia,"",142,035,""
203203+Sint Maarten (Dutch part),SX,SXM,534,ISO 3166-2:SX,Americas,Latin America and the Caribbean,Caribbean,019,419,029
204204+Slovakia,SK,SVK,703,ISO 3166-2:SK,Europe,Eastern Europe,"",150,151,""
205205+Slovenia,SI,SVN,705,ISO 3166-2:SI,Europe,Southern Europe,"",150,039,""
206206+Solomon Islands,SB,SLB,090,ISO 3166-2:SB,Oceania,Melanesia,"",009,054,""
207207+Somalia,SO,SOM,706,ISO 3166-2:SO,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
208208+South Africa,ZA,ZAF,710,ISO 3166-2:ZA,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
209209+South Georgia and the South Sandwich Islands,GS,SGS,239,ISO 3166-2:GS,Americas,Latin America and the Caribbean,South America,019,419,005
210210+South Sudan,SS,SSD,728,ISO 3166-2:SS,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
211211+Spain,ES,ESP,724,ISO 3166-2:ES,Europe,Southern Europe,"",150,039,""
212212+Sri Lanka,LK,LKA,144,ISO 3166-2:LK,Asia,Southern Asia,"",142,034,""
213213+Sudan,SD,SDN,729,ISO 3166-2:SD,Africa,Northern Africa,"",002,015,""
214214+Suriname,SR,SUR,740,ISO 3166-2:SR,Americas,Latin America and the Caribbean,South America,019,419,005
215215+Svalbard and Jan Mayen,SJ,SJM,744,ISO 3166-2:SJ,Europe,Northern Europe,"",150,154,""
216216+Sweden,SE,SWE,752,ISO 3166-2:SE,Europe,Northern Europe,"",150,154,""
217217+Switzerland,CH,CHE,756,ISO 3166-2:CH,Europe,Western Europe,"",150,155,""
218218+Syrian Arab Republic,SY,SYR,760,ISO 3166-2:SY,Asia,Western Asia,"",142,145,""
219219+"Taiwan, Province of China",TW,TWN,158,ISO 3166-2:TW,Asia,Eastern Asia,"",142,030,""
220220+Tajikistan,TJ,TJK,762,ISO 3166-2:TJ,Asia,Central Asia,"",142,143,""
221221+"Tanzania, United Republic of",TZ,TZA,834,ISO 3166-2:TZ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
222222+Thailand,TH,THA,764,ISO 3166-2:TH,Asia,South-eastern Asia,"",142,035,""
223223+Timor-Leste,TL,TLS,626,ISO 3166-2:TL,Asia,South-eastern Asia,"",142,035,""
224224+Togo,TG,TGO,768,ISO 3166-2:TG,Africa,Sub-Saharan Africa,Western Africa,002,202,011
225225+Tokelau,TK,TKL,772,ISO 3166-2:TK,Oceania,Polynesia,"",009,061,""
226226+Tonga,TO,TON,776,ISO 3166-2:TO,Oceania,Polynesia,"",009,061,""
227227+Trinidad and Tobago,TT,TTO,780,ISO 3166-2:TT,Americas,Latin America and the Caribbean,Caribbean,019,419,029
228228+Tunisia,TN,TUN,788,ISO 3166-2:TN,Africa,Northern Africa,"",002,015,""
229229+Turkey,TR,TUR,792,ISO 3166-2:TR,Asia,Western Asia,"",142,145,""
230230+Turkmenistan,TM,TKM,795,ISO 3166-2:TM,Asia,Central Asia,"",142,143,""
231231+Turks and Caicos Islands,TC,TCA,796,ISO 3166-2:TC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
232232+Tuvalu,TV,TUV,798,ISO 3166-2:TV,Oceania,Polynesia,"",009,061,""
233233+Uganda,UG,UGA,800,ISO 3166-2:UG,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
234234+Ukraine,UA,UKR,804,ISO 3166-2:UA,Europe,Eastern Europe,"",150,151,""
235235+United Arab Emirates,AE,ARE,784,ISO 3166-2:AE,Asia,Western Asia,"",142,145,""
236236+United Kingdom of Great Britain and Northern Ireland,GB,GBR,826,ISO 3166-2:GB,Europe,Northern Europe,"",150,154,""
237237+United States of America,US,USA,840,ISO 3166-2:US,Americas,Northern America,"",019,021,""
238238+United States Minor Outlying Islands,UM,UMI,581,ISO 3166-2:UM,Oceania,Micronesia,"",009,057,""
239239+Uruguay,UY,URY,858,ISO 3166-2:UY,Americas,Latin America and the Caribbean,South America,019,419,005
240240+Uzbekistan,UZ,UZB,860,ISO 3166-2:UZ,Asia,Central Asia,"",142,143,""
241241+Vanuatu,VU,VUT,548,ISO 3166-2:VU,Oceania,Melanesia,"",009,054,""
242242+Venezuela (Bolivarian Republic of),VE,VEN,862,ISO 3166-2:VE,Americas,Latin America and the Caribbean,South America,019,419,005
243243+Viet Nam,VN,VNM,704,ISO 3166-2:VN,Asia,South-eastern Asia,"",142,035,""
244244+Virgin Islands (British),VG,VGB,092,ISO 3166-2:VG,Americas,Latin America and the Caribbean,Caribbean,019,419,029
245245+Virgin Islands (U.S.),VI,VIR,850,ISO 3166-2:VI,Americas,Latin America and the Caribbean,Caribbean,019,419,029
246246+Wallis and Futuna,WF,WLF,876,ISO 3166-2:WF,Oceania,Polynesia,"",009,061,""
247247+Western Sahara,EH,ESH,732,ISO 3166-2:EH,Africa,Northern Africa,"",002,015,""
248248+Yemen,YE,YEM,887,ISO 3166-2:YE,Asia,Western Asia,"",142,145,""
249249+Zambia,ZM,ZMB,894,ISO 3166-2:ZM,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
250250+Zimbabwe,ZW,ZWE,716,ISO 3166-2:ZW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
+5
vendor/opam/ISO3166/src/gen/dune
···11+; Enable to change the interface and implementation of this libray
22+33+; (executable
44+; (name main)
55+; (libraries))
+262
vendor/opam/ISO3166/src/gen/main.ml
···11+type country = {
22+ name : string;
33+ alpha_2 : string;
44+ alpha_3 : string;
55+ numeric : int;
66+ region : string;
77+ sub_region : string;
88+}
99+1010+let parse_csv_line ~expected s =
1111+ let columns = String.split_on_char ',' s in
1212+ if List.length columns = expected then columns
1313+ else
1414+ let rec aux acc = function
1515+ | x :: y :: rest when x.[0] = '"' && x.[1] <> '"' ->
1616+ let join = x ^ y in
1717+ let s = String.sub join 1 (String.length join - 2) in
1818+ aux (s :: acc) rest
1919+ | x :: xs -> aux (x :: acc) xs
2020+ | [] -> List.rev acc
2121+ in
2222+ aux [] columns
2323+2424+let country_of_string ~expected s =
2525+ match parse_csv_line ~expected s with
2626+ | name :: alpha_2 :: alpha_3 :: numeric :: _iso_3166_2 :: region :: sub_region
2727+ :: _ ->
2828+ {
2929+ name;
3030+ alpha_2;
3131+ alpha_3;
3232+ numeric = int_of_string numeric;
3333+ region;
3434+ sub_region;
3535+ }
3636+ | _ -> failwith ("Malformed country: " ^ s)
3737+3838+module OCaml = struct
3939+ let pf = Format.fprintf
4040+ let pp_list ?sep = Format.pp_print_list ?pp_sep:sep
4141+ let pp_string = Format.pp_print_string
4242+ let pp_string_q ppf = pf ppf {|"%s"|}
4343+ let const v ppf () = pf ppf "%s" v
4444+ let pp_poly_var ppf s = pf ppf "`%s" s
4545+4646+ let pp_type_poly_var ppf (k, s) =
4747+ pf ppf "type %s = [ %a ]" k (pp_list ~sep:(const " | ") pp_poly_var) s
4848+4949+ let alpha_2_of_countries ppf cs =
5050+ let cs = List.map (fun v -> v.alpha_2) cs in
5151+ pf ppf "%a" pp_type_poly_var ("alpha2", cs)
5252+5353+ let pp_case ppf = pf ppf "| %a -> %a"
5454+5555+ let alpha_2_to_string ppf cs =
5656+ let cs = List.map (fun v -> (v.alpha_2, v.alpha_2)) cs in
5757+ let pp ppf (c, v) = pp_case ppf pp_poly_var c pp_string_q v in
5858+ pf ppf "let alpha2_to_string = function\n %a" (pp_list pp) cs
5959+6060+ let alpha_2_of_string ppf cs =
6161+ let cs = List.map (fun v -> (v.alpha_2, v.alpha_2)) cs in
6262+ let pp ppf (c, v) = pp_case ppf pp_string_q c pp_poly_var v in
6363+ pf ppf
6464+ "let alpha2_of_string = function\n\
6565+ \ %a\n\
6666+ | s -> failwith (\"Invalid Alpha 2 code: \" ^ s)" (pp_list pp) cs
6767+6868+ let alpha_3_of_countries ppf cs =
6969+ let cs = List.map (fun v -> v.alpha_3) cs in
7070+ pf ppf "%a" pp_type_poly_var ("alpha3", cs)
7171+7272+ let alpha_3_to_string ppf cs =
7373+ let cs = List.map (fun v -> (v.alpha_3, v.alpha_3)) cs in
7474+ let pp ppf (c, v) = pp_case ppf pp_poly_var c pp_string_q v in
7575+ pf ppf "let alpha3_to_string = function\n %a" (pp_list pp) cs
7676+7777+ let alpha_3_of_string ppf cs =
7878+ let cs = List.map (fun v -> (v.alpha_3, v.alpha_3)) cs in
7979+ let pp ppf (c, v) = pp_case ppf pp_string_q c pp_poly_var v in
8080+ pf ppf
8181+ "let alpha3_of_string = function\n\
8282+ \ %a\n\
8383+ | s -> failwith (\"Invalid Alpha 3 code: \" ^ s)" (pp_list pp) cs
8484+8585+ let pp_module name ppf = pf ppf "module %s = struct\n\n%a\n\nend" name
8686+8787+ let pp_country_type =
8888+ const
8989+ "type t = { name : string; alpha2 : alpha2; alpha3 : alpha3; numeric : \
9090+ int; region : string option; sub_region : string option }"
9191+9292+ let keywords = [ "as"; "to"; "in"; "do" ]
9393+9494+ let get_name c =
9595+ let s = String.lowercase_ascii c.alpha_2 in
9696+ if List.mem s keywords then s ^ "'" else s
9797+9898+ let pp_country ppf (c : country) =
9999+ let pp_str_opt ppf s =
100100+ if s <> "\"\"" then pf ppf "(Some \"%s\")" s else pf ppf "None"
101101+ in
102102+ let name = get_name c in
103103+ pf ppf
104104+ "let %s = { name=\"%s\"; alpha2=%a; alpha3=%a; numeric=%i; region=%a; \
105105+ sub_region=%a}%!"
106106+ name c.name pp_poly_var c.alpha_2 pp_poly_var c.alpha_3 c.numeric
107107+ pp_str_opt c.region pp_str_opt c.sub_region
108108+109109+ let pp_country_impl =
110110+ const
111111+ {|
112112+ let alpha2 t = t.alpha2
113113+ let alpha3 t = t.alpha3
114114+ let numeric t = t.numeric
115115+ let name t = t.name
116116+ let region t = t.region
117117+ let sub_region t = t.sub_region
118118+ |}
119119+120120+ let pp_country_module ppf cs =
121121+ let pp_impl ppf () =
122122+ pf ppf "%a\n\n%a\n\n%a" pp_country_type () pp_country_impl ()
123123+ (pp_list pp_country) cs
124124+ in
125125+ pp_module "Country" ppf pp_impl ()
126126+127127+ let pp_country_mli ppf c =
128128+ let name = get_name c in
129129+ pf ppf "val %s : t\n(** Country information for %s. *)\n\n"
130130+ (String.lowercase_ascii name)
131131+ c.name
132132+133133+ let pp_country_module_mli ppf cs =
134134+ pf ppf
135135+ {|
136136+ module Country : sig
137137+ type t
138138+ (** A country as defined by ISO3166. *)
139139+140140+ val alpha2 : t -> alpha2
141141+ (** The two letter country code. *)
142142+143143+ val alpha3 : t -> alpha3
144144+ (** The three letter country code. *)
145145+146146+ val numeric : t -> numeric
147147+ (** The numeric country code. *)
148148+149149+ val name : t -> string
150150+ (** The english name of the country *)
151151+152152+ val region : t -> string option
153153+ (** The {{: https://unstats.un.org/unsd/methodology/m49/overview} english region} name for the country. *)
154154+155155+ val sub_region : t -> string option
156156+ (** The {{: https://unstats.un.org/unsd/methodology/m49/overview} english sub-region} name for the country. *)
157157+158158+ %a
159159+160160+ end
161161+ |}
162162+ (pp_list ~sep:(const "\n") pp_country_mli)
163163+ cs
164164+165165+ let pp_alpha2_to_country ppf cs =
166166+ let cs = List.map (fun v -> (v.alpha_2, "Country." ^ get_name v)) cs in
167167+ let pp ppf (c, v) = pp_case ppf pp_poly_var c pp_string v in
168168+ pf ppf "let alpha2_to_country = function\n %a\n" (pp_list pp) cs
169169+170170+ let pp_alpha3_to_country ppf cs =
171171+ let cs = List.map (fun v -> (v.alpha_3, "Country." ^ get_name v)) cs in
172172+ let pp ppf (c, v) = pp_case ppf pp_poly_var c pp_string v in
173173+ pf ppf "let alpha3_to_country = function\n %a\n" (pp_list pp) cs
174174+175175+ let pp_numeric_to_country ppf cs =
176176+ let cs = List.map (fun v -> (v.numeric, "Country." ^ get_name v)) cs in
177177+ let pp ppf (c, v) = pp_case ppf Format.pp_print_int c pp_string v in
178178+ pf ppf
179179+ "let numeric_to_country = function\n\
180180+ \ %a\n\
181181+ | _ -> invalid_arg (\"No such country with numerical code\")"
182182+ (pp_list pp) cs
183183+184184+ let numeric_impl =
185185+ const
186186+ {|
187187+ type numeric = int
188188+ let numeric_to_int v = v
189189+ let numeric_of_int v =
190190+ if v < 0 || v > 999 then invalid_arg "Numeric country code is not between 0-999"
191191+ else v
192192+193193+ let numeric_to_string v =
194194+ if v < 10 then "00" ^ string_of_int v
195195+ else if v >= 10 && v < 100 then "0" ^ string_of_int v
196196+ else string_of_int v
197197+198198+ let numeric_of_string v =
199199+ numeric_of_int (int_of_string v)
200200+ |}
201201+202202+ let numeric_intf =
203203+ const
204204+ {|
205205+ type numeric
206206+ (** An abstract type to represent a three-digit country code. *)
207207+208208+ val numeric_to_int : numeric -> int
209209+ (** The integer representation of the three-digit code. Note this won't be
210210+ three-digits if less than [100]. Use {! numeric_to_string} if you need that. *)
211211+212212+ val numeric_of_int : int -> numeric
213213+ (** Convert from an integer, this will only check that the number falls between [0-999]
214214+ and raise [Invalid_argument] if it doesn't. There is no check that the integer is in fact
215215+ a valid, assigned numeric country code. *)
216216+217217+ val numeric_to_string : numeric -> string
218218+ (** Conversion to a three-digit string representation. *)
219219+220220+ val numeric_of_string : string -> numeric
221221+ (** This is [numeric_of_int (int_of_string v)]. *)
222222+ |}
223223+end
224224+225225+let implementation countries =
226226+ Format.printf "%a\n\n" OCaml.alpha_2_of_countries countries;
227227+ Format.printf "%a\n\n" OCaml.alpha_2_to_string countries;
228228+ Format.printf "%a\n\n" OCaml.alpha_2_of_string countries;
229229+ Format.printf "%a\n\n" OCaml.alpha_3_of_countries countries;
230230+ Format.printf "%a\n\n" OCaml.alpha_3_to_string countries;
231231+ Format.printf "%a\n\n" OCaml.alpha_3_of_string countries;
232232+ Format.printf "%a\n\n" OCaml.numeric_impl ();
233233+ Format.printf "%a\n\n" OCaml.pp_country_module countries;
234234+ Format.printf "%a\n\n" OCaml.pp_alpha2_to_country countries;
235235+ Format.printf "%a\n\n" OCaml.pp_alpha3_to_country countries;
236236+ Format.printf "%a\n\n" OCaml.pp_numeric_to_country countries
237237+238238+let interface countries =
239239+ Format.printf "%a\n\n" OCaml.alpha_2_of_countries countries;
240240+ Format.printf "val alpha2_to_string : alpha2 -> string\n\n";
241241+ Format.printf "val alpha2_of_string : string -> alpha2\n\n";
242242+ Format.printf "%a\n\n" OCaml.alpha_3_of_countries countries;
243243+ Format.printf "val alpha3_to_string : alpha3 -> string\n\n";
244244+ Format.printf "val alpha3_of_string : string -> alpha3\n\n";
245245+ Format.printf "%a\n\n" OCaml.numeric_intf ();
246246+ Format.printf "%a" OCaml.pp_country_module_mli countries;
247247+ Format.printf "val alpha2_to_country : alpha2 -> Country.t\n\n";
248248+ Format.printf "val alpha3_to_country : alpha3 -> Country.t\n\n";
249249+ Format.printf "val numeric_to_country : int -> Country.t\n\n"
250250+251251+let () =
252252+ let lines = Os.get_lines "../data.csv" in
253253+ let header, data =
254254+ (String.split_on_char ',' (List.hd lines), List.tl lines)
255255+ in
256256+ let countries =
257257+ List.map (country_of_string ~expected:(List.length header)) data
258258+ in
259259+ try
260260+ if Sys.argv.(1) = "mli" then interface countries
261261+ else implementation countries
262262+ with _ -> implementation countries
+19
vendor/opam/ISO3166/src/gen/os.ml
···11+let with_file path fn =
22+ let ic = open_in path in
33+ try fn ic with _ -> close_in ic
44+55+let with_lines path fn =
66+ with_file path @@ fun ic ->
77+ let rec aux () =
88+ try
99+ fn (input_line ic);
1010+ aux ()
1111+ with End_of_file -> ()
1212+ in
1313+ aux ()
1414+1515+let get_lines path =
1616+ let lines = ref [] in
1717+ let run () = with_lines path @@ fun line -> lines := line :: !lines in
1818+ run ();
1919+ List.rev !lines
···11+type alpha2 =
22+ [ `AF
33+ | `AX
44+ | `AL
55+ | `DZ
66+ | `AS
77+ | `AD
88+ | `AO
99+ | `AI
1010+ | `AQ
1111+ | `AG
1212+ | `AR
1313+ | `AM
1414+ | `AW
1515+ | `AU
1616+ | `AT
1717+ | `AZ
1818+ | `BS
1919+ | `BH
2020+ | `BD
2121+ | `BB
2222+ | `BY
2323+ | `BE
2424+ | `BZ
2525+ | `BJ
2626+ | `BM
2727+ | `BT
2828+ | `BO
2929+ | `BQ
3030+ | `BA
3131+ | `BW
3232+ | `BV
3333+ | `BR
3434+ | `IO
3535+ | `BN
3636+ | `BG
3737+ | `BF
3838+ | `BI
3939+ | `CV
4040+ | `KH
4141+ | `CM
4242+ | `CA
4343+ | `KY
4444+ | `CF
4545+ | `TD
4646+ | `CL
4747+ | `CN
4848+ | `CX
4949+ | `CC
5050+ | `CO
5151+ | `KM
5252+ | `CG
5353+ | `CD
5454+ | `CK
5555+ | `CR
5656+ | `CI
5757+ | `HR
5858+ | `CU
5959+ | `CW
6060+ | `CY
6161+ | `CZ
6262+ | `DK
6363+ | `DJ
6464+ | `DM
6565+ | `DO
6666+ | `EC
6767+ | `EG
6868+ | `SV
6969+ | `GQ
7070+ | `ER
7171+ | `EE
7272+ | `SZ
7373+ | `ET
7474+ | `FK
7575+ | `FO
7676+ | `FJ
7777+ | `FI
7878+ | `FR
7979+ | `GF
8080+ | `PF
8181+ | `TF
8282+ | `GA
8383+ | `GM
8484+ | `GE
8585+ | `DE
8686+ | `GH
8787+ | `GI
8888+ | `GR
8989+ | `GL
9090+ | `GD
9191+ | `GP
9292+ | `GU
9393+ | `GT
9494+ | `GG
9595+ | `GN
9696+ | `GW
9797+ | `GY
9898+ | `HT
9999+ | `HM
100100+ | `VA
101101+ | `HN
102102+ | `HK
103103+ | `HU
104104+ | `IS
105105+ | `IN
106106+ | `ID
107107+ | `IR
108108+ | `IQ
109109+ | `IE
110110+ | `IM
111111+ | `IL
112112+ | `IT
113113+ | `JM
114114+ | `JP
115115+ | `JE
116116+ | `JO
117117+ | `KZ
118118+ | `KE
119119+ | `KI
120120+ | `KP
121121+ | `KR
122122+ | `KW
123123+ | `KG
124124+ | `LA
125125+ | `LV
126126+ | `LB
127127+ | `LS
128128+ | `LR
129129+ | `LY
130130+ | `LI
131131+ | `LT
132132+ | `LU
133133+ | `MO
134134+ | `MG
135135+ | `MW
136136+ | `MY
137137+ | `MV
138138+ | `ML
139139+ | `MT
140140+ | `MH
141141+ | `MQ
142142+ | `MR
143143+ | `MU
144144+ | `YT
145145+ | `MX
146146+ | `FM
147147+ | `MD
148148+ | `MC
149149+ | `MN
150150+ | `ME
151151+ | `MS
152152+ | `MA
153153+ | `MZ
154154+ | `MM
155155+ | `NA
156156+ | `NR
157157+ | `NP
158158+ | `NL
159159+ | `NC
160160+ | `NZ
161161+ | `NI
162162+ | `NE
163163+ | `NG
164164+ | `NU
165165+ | `NF
166166+ | `MK
167167+ | `MP
168168+ | `NO
169169+ | `OM
170170+ | `PK
171171+ | `PW
172172+ | `PS
173173+ | `PA
174174+ | `PG
175175+ | `PY
176176+ | `PE
177177+ | `PH
178178+ | `PN
179179+ | `PL
180180+ | `PT
181181+ | `PR
182182+ | `QA
183183+ | `RE
184184+ | `RO
185185+ | `RU
186186+ | `RW
187187+ | `BL
188188+ | `SH
189189+ | `KN
190190+ | `LC
191191+ | `MF
192192+ | `PM
193193+ | `VC
194194+ | `WS
195195+ | `SM
196196+ | `ST
197197+ | `SA
198198+ | `SN
199199+ | `RS
200200+ | `SC
201201+ | `SL
202202+ | `SG
203203+ | `SX
204204+ | `SK
205205+ | `SI
206206+ | `SB
207207+ | `SO
208208+ | `ZA
209209+ | `GS
210210+ | `SS
211211+ | `ES
212212+ | `LK
213213+ | `SD
214214+ | `SR
215215+ | `SJ
216216+ | `SE
217217+ | `CH
218218+ | `SY
219219+ | `TW
220220+ | `TJ
221221+ | `TZ
222222+ | `TH
223223+ | `TL
224224+ | `TG
225225+ | `TK
226226+ | `TO
227227+ | `TT
228228+ | `TN
229229+ | `TR
230230+ | `TM
231231+ | `TC
232232+ | `TV
233233+ | `UG
234234+ | `UA
235235+ | `AE
236236+ | `GB
237237+ | `US
238238+ | `UM
239239+ | `UY
240240+ | `UZ
241241+ | `VU
242242+ | `VE
243243+ | `VN
244244+ | `VG
245245+ | `VI
246246+ | `WF
247247+ | `EH
248248+ | `YE
249249+ | `ZM
250250+ | `ZW ]
251251+252252+val alpha2_to_string : alpha2 -> string
253253+val alpha2_of_string : string -> alpha2
254254+255255+type alpha3 =
256256+ [ `AFG
257257+ | `ALA
258258+ | `ALB
259259+ | `DZA
260260+ | `ASM
261261+ | `AND
262262+ | `AGO
263263+ | `AIA
264264+ | `ATA
265265+ | `ATG
266266+ | `ARG
267267+ | `ARM
268268+ | `ABW
269269+ | `AUS
270270+ | `AUT
271271+ | `AZE
272272+ | `BHS
273273+ | `BHR
274274+ | `BGD
275275+ | `BRB
276276+ | `BLR
277277+ | `BEL
278278+ | `BLZ
279279+ | `BEN
280280+ | `BMU
281281+ | `BTN
282282+ | `BOL
283283+ | `BES
284284+ | `BIH
285285+ | `BWA
286286+ | `BVT
287287+ | `BRA
288288+ | `IOT
289289+ | `BRN
290290+ | `BGR
291291+ | `BFA
292292+ | `BDI
293293+ | `CPV
294294+ | `KHM
295295+ | `CMR
296296+ | `CAN
297297+ | `CYM
298298+ | `CAF
299299+ | `TCD
300300+ | `CHL
301301+ | `CHN
302302+ | `CXR
303303+ | `CCK
304304+ | `COL
305305+ | `COM
306306+ | `COG
307307+ | `COD
308308+ | `COK
309309+ | `CRI
310310+ | `CIV
311311+ | `HRV
312312+ | `CUB
313313+ | `CUW
314314+ | `CYP
315315+ | `CZE
316316+ | `DNK
317317+ | `DJI
318318+ | `DMA
319319+ | `DOM
320320+ | `ECU
321321+ | `EGY
322322+ | `SLV
323323+ | `GNQ
324324+ | `ERI
325325+ | `EST
326326+ | `SWZ
327327+ | `ETH
328328+ | `FLK
329329+ | `FRO
330330+ | `FJI
331331+ | `FIN
332332+ | `FRA
333333+ | `GUF
334334+ | `PYF
335335+ | `ATF
336336+ | `GAB
337337+ | `GMB
338338+ | `GEO
339339+ | `DEU
340340+ | `GHA
341341+ | `GIB
342342+ | `GRC
343343+ | `GRL
344344+ | `GRD
345345+ | `GLP
346346+ | `GUM
347347+ | `GTM
348348+ | `GGY
349349+ | `GIN
350350+ | `GNB
351351+ | `GUY
352352+ | `HTI
353353+ | `HMD
354354+ | `VAT
355355+ | `HND
356356+ | `HKG
357357+ | `HUN
358358+ | `ISL
359359+ | `IND
360360+ | `IDN
361361+ | `IRN
362362+ | `IRQ
363363+ | `IRL
364364+ | `IMN
365365+ | `ISR
366366+ | `ITA
367367+ | `JAM
368368+ | `JPN
369369+ | `JEY
370370+ | `JOR
371371+ | `KAZ
372372+ | `KEN
373373+ | `KIR
374374+ | `PRK
375375+ | `KOR
376376+ | `KWT
377377+ | `KGZ
378378+ | `LAO
379379+ | `LVA
380380+ | `LBN
381381+ | `LSO
382382+ | `LBR
383383+ | `LBY
384384+ | `LIE
385385+ | `LTU
386386+ | `LUX
387387+ | `MAC
388388+ | `MDG
389389+ | `MWI
390390+ | `MYS
391391+ | `MDV
392392+ | `MLI
393393+ | `MLT
394394+ | `MHL
395395+ | `MTQ
396396+ | `MRT
397397+ | `MUS
398398+ | `MYT
399399+ | `MEX
400400+ | `FSM
401401+ | `MDA
402402+ | `MCO
403403+ | `MNG
404404+ | `MNE
405405+ | `MSR
406406+ | `MAR
407407+ | `MOZ
408408+ | `MMR
409409+ | `NAM
410410+ | `NRU
411411+ | `NPL
412412+ | `NLD
413413+ | `NCL
414414+ | `NZL
415415+ | `NIC
416416+ | `NER
417417+ | `NGA
418418+ | `NIU
419419+ | `NFK
420420+ | `MKD
421421+ | `MNP
422422+ | `NOR
423423+ | `OMN
424424+ | `PAK
425425+ | `PLW
426426+ | `PSE
427427+ | `PAN
428428+ | `PNG
429429+ | `PRY
430430+ | `PER
431431+ | `PHL
432432+ | `PCN
433433+ | `POL
434434+ | `PRT
435435+ | `PRI
436436+ | `QAT
437437+ | `REU
438438+ | `ROU
439439+ | `RUS
440440+ | `RWA
441441+ | `BLM
442442+ | `SHN
443443+ | `KNA
444444+ | `LCA
445445+ | `MAF
446446+ | `SPM
447447+ | `VCT
448448+ | `WSM
449449+ | `SMR
450450+ | `STP
451451+ | `SAU
452452+ | `SEN
453453+ | `SRB
454454+ | `SYC
455455+ | `SLE
456456+ | `SGP
457457+ | `SXM
458458+ | `SVK
459459+ | `SVN
460460+ | `SLB
461461+ | `SOM
462462+ | `ZAF
463463+ | `SGS
464464+ | `SSD
465465+ | `ESP
466466+ | `LKA
467467+ | `SDN
468468+ | `SUR
469469+ | `SJM
470470+ | `SWE
471471+ | `CHE
472472+ | `SYR
473473+ | `TWN
474474+ | `TJK
475475+ | `TZA
476476+ | `THA
477477+ | `TLS
478478+ | `TGO
479479+ | `TKL
480480+ | `TON
481481+ | `TTO
482482+ | `TUN
483483+ | `TUR
484484+ | `TKM
485485+ | `TCA
486486+ | `TUV
487487+ | `UGA
488488+ | `UKR
489489+ | `ARE
490490+ | `GBR
491491+ | `USA
492492+ | `UMI
493493+ | `URY
494494+ | `UZB
495495+ | `VUT
496496+ | `VEN
497497+ | `VNM
498498+ | `VGB
499499+ | `VIR
500500+ | `WLF
501501+ | `ESH
502502+ | `YEM
503503+ | `ZMB
504504+ | `ZWE ]
505505+506506+val alpha3_to_string : alpha3 -> string
507507+val alpha3_of_string : string -> alpha3
508508+509509+type numeric
510510+(** An abstract type to represent a three-digit country code. *)
511511+512512+val numeric_to_int : numeric -> int
513513+(** The integer representation of the three-digit code. Note this won't be
514514+ three-digits if less than [100]. Use {! numeric_to_string} if you need that. *)
515515+516516+val numeric_of_int : int -> numeric
517517+(** Convert from an integer, this will only check that the number falls between [0-999]
518518+ and raise [Invalid_argument] if it doesn't. There is no check that the integer is in fact
519519+ a valid, assigned numeric country code. *)
520520+521521+val numeric_to_string : numeric -> string
522522+(** Conversion to a three-digit string representation. *)
523523+524524+val numeric_of_string : string -> numeric
525525+(** This is [numeric_of_int (int_of_string v)]. *)
526526+527527+module Country : sig
528528+ type t
529529+ (** A country as defined by ISO3166. *)
530530+531531+ val alpha2 : t -> alpha2
532532+ (** The two letter country code. *)
533533+534534+ val alpha3 : t -> alpha3
535535+ (** The three letter country code. *)
536536+537537+ val numeric : t -> numeric
538538+ (** The numeric country code. *)
539539+540540+ val name : t -> string
541541+ (** The english name of the country *)
542542+543543+ val region : t -> string option
544544+ (** The {{: https://unstats.un.org/unsd/methodology/m49/overview} english region} name for the country. *)
545545+546546+ val sub_region : t -> string option
547547+ (** The {{: https://unstats.un.org/unsd/methodology/m49/overview} english sub-region} name for the country. *)
548548+549549+ val af : t
550550+ (** Country information for Afghanistan. *)
551551+552552+ val ax : t
553553+ (** Country information for Åland Islands. *)
554554+555555+ val al : t
556556+ (** Country information for Albania. *)
557557+558558+ val dz : t
559559+ (** Country information for Algeria. *)
560560+561561+ val as' : t
562562+ (** Country information for American Samoa. *)
563563+564564+ val ad : t
565565+ (** Country information for Andorra. *)
566566+567567+ val ao : t
568568+ (** Country information for Angola. *)
569569+570570+ val ai : t
571571+ (** Country information for Anguilla. *)
572572+573573+ val aq : t
574574+ (** Country information for Antarctica. *)
575575+576576+ val ag : t
577577+ (** Country information for Antigua and Barbuda. *)
578578+579579+ val ar : t
580580+ (** Country information for Argentina. *)
581581+582582+ val am : t
583583+ (** Country information for Armenia. *)
584584+585585+ val aw : t
586586+ (** Country information for Aruba. *)
587587+588588+ val au : t
589589+ (** Country information for Australia. *)
590590+591591+ val at : t
592592+ (** Country information for Austria. *)
593593+594594+ val az : t
595595+ (** Country information for Azerbaijan. *)
596596+597597+ val bs : t
598598+ (** Country information for Bahamas. *)
599599+600600+ val bh : t
601601+ (** Country information for Bahrain. *)
602602+603603+ val bd : t
604604+ (** Country information for Bangladesh. *)
605605+606606+ val bb : t
607607+ (** Country information for Barbados. *)
608608+609609+ val by : t
610610+ (** Country information for Belarus. *)
611611+612612+ val be : t
613613+ (** Country information for Belgium. *)
614614+615615+ val bz : t
616616+ (** Country information for Belize. *)
617617+618618+ val bj : t
619619+ (** Country information for Benin. *)
620620+621621+ val bm : t
622622+ (** Country information for Bermuda. *)
623623+624624+ val bt : t
625625+ (** Country information for Bhutan. *)
626626+627627+ val bo : t
628628+ (** Country information for Bolivia (Plurinational State of). *)
629629+630630+ val bq : t
631631+ (** Country information for Bonaire Sint Eustatius and Saba. *)
632632+633633+ val ba : t
634634+ (** Country information for Bosnia and Herzegovina. *)
635635+636636+ val bw : t
637637+ (** Country information for Botswana. *)
638638+639639+ val bv : t
640640+ (** Country information for Bouvet Island. *)
641641+642642+ val br : t
643643+ (** Country information for Brazil. *)
644644+645645+ val io : t
646646+ (** Country information for British Indian Ocean Territory. *)
647647+648648+ val bn : t
649649+ (** Country information for Brunei Darussalam. *)
650650+651651+ val bg : t
652652+ (** Country information for Bulgaria. *)
653653+654654+ val bf : t
655655+ (** Country information for Burkina Faso. *)
656656+657657+ val bi : t
658658+ (** Country information for Burundi. *)
659659+660660+ val cv : t
661661+ (** Country information for Cabo Verde. *)
662662+663663+ val kh : t
664664+ (** Country information for Cambodia. *)
665665+666666+ val cm : t
667667+ (** Country information for Cameroon. *)
668668+669669+ val ca : t
670670+ (** Country information for Canada. *)
671671+672672+ val ky : t
673673+ (** Country information for Cayman Islands. *)
674674+675675+ val cf : t
676676+ (** Country information for Central African Republic. *)
677677+678678+ val td : t
679679+ (** Country information for Chad. *)
680680+681681+ val cl : t
682682+ (** Country information for Chile. *)
683683+684684+ val cn : t
685685+ (** Country information for China. *)
686686+687687+ val cx : t
688688+ (** Country information for Christmas Island. *)
689689+690690+ val cc : t
691691+ (** Country information for Cocos (Keeling) Islands. *)
692692+693693+ val co : t
694694+ (** Country information for Colombia. *)
695695+696696+ val km : t
697697+ (** Country information for Comoros. *)
698698+699699+ val cg : t
700700+ (** Country information for Congo. *)
701701+702702+ val cd : t
703703+ (** Country information for Congo Democratic Republic of the. *)
704704+705705+ val ck : t
706706+ (** Country information for Cook Islands. *)
707707+708708+ val cr : t
709709+ (** Country information for Costa Rica. *)
710710+711711+ val ci : t
712712+ (** Country information for Côte d'Ivoire. *)
713713+714714+ val hr : t
715715+ (** Country information for Croatia. *)
716716+717717+ val cu : t
718718+ (** Country information for Cuba. *)
719719+720720+ val cw : t
721721+ (** Country information for Curaçao. *)
722722+723723+ val cy : t
724724+ (** Country information for Cyprus. *)
725725+726726+ val cz : t
727727+ (** Country information for Czechia. *)
728728+729729+ val dk : t
730730+ (** Country information for Denmark. *)
731731+732732+ val dj : t
733733+ (** Country information for Djibouti. *)
734734+735735+ val dm : t
736736+ (** Country information for Dominica. *)
737737+738738+ val do' : t
739739+ (** Country information for Dominican Republic. *)
740740+741741+ val ec : t
742742+ (** Country information for Ecuador. *)
743743+744744+ val eg : t
745745+ (** Country information for Egypt. *)
746746+747747+ val sv : t
748748+ (** Country information for El Salvador. *)
749749+750750+ val gq : t
751751+ (** Country information for Equatorial Guinea. *)
752752+753753+ val er : t
754754+ (** Country information for Eritrea. *)
755755+756756+ val ee : t
757757+ (** Country information for Estonia. *)
758758+759759+ val sz : t
760760+ (** Country information for Eswatini. *)
761761+762762+ val et : t
763763+ (** Country information for Ethiopia. *)
764764+765765+ val fk : t
766766+ (** Country information for Falkland Islands (Malvinas). *)
767767+768768+ val fo : t
769769+ (** Country information for Faroe Islands. *)
770770+771771+ val fj : t
772772+ (** Country information for Fiji. *)
773773+774774+ val fi : t
775775+ (** Country information for Finland. *)
776776+777777+ val fr : t
778778+ (** Country information for France. *)
779779+780780+ val gf : t
781781+ (** Country information for French Guiana. *)
782782+783783+ val pf : t
784784+ (** Country information for French Polynesia. *)
785785+786786+ val tf : t
787787+ (** Country information for French Southern Territories. *)
788788+789789+ val ga : t
790790+ (** Country information for Gabon. *)
791791+792792+ val gm : t
793793+ (** Country information for Gambia. *)
794794+795795+ val ge : t
796796+ (** Country information for Georgia. *)
797797+798798+ val de : t
799799+ (** Country information for Germany. *)
800800+801801+ val gh : t
802802+ (** Country information for Ghana. *)
803803+804804+ val gi : t
805805+ (** Country information for Gibraltar. *)
806806+807807+ val gr : t
808808+ (** Country information for Greece. *)
809809+810810+ val gl : t
811811+ (** Country information for Greenland. *)
812812+813813+ val gd : t
814814+ (** Country information for Grenada. *)
815815+816816+ val gp : t
817817+ (** Country information for Guadeloupe. *)
818818+819819+ val gu : t
820820+ (** Country information for Guam. *)
821821+822822+ val gt : t
823823+ (** Country information for Guatemala. *)
824824+825825+ val gg : t
826826+ (** Country information for Guernsey. *)
827827+828828+ val gn : t
829829+ (** Country information for Guinea. *)
830830+831831+ val gw : t
832832+ (** Country information for Guinea-Bissau. *)
833833+834834+ val gy : t
835835+ (** Country information for Guyana. *)
836836+837837+ val ht : t
838838+ (** Country information for Haiti. *)
839839+840840+ val hm : t
841841+ (** Country information for Heard Island and McDonald Islands. *)
842842+843843+ val va : t
844844+ (** Country information for Holy See. *)
845845+846846+ val hn : t
847847+ (** Country information for Honduras. *)
848848+849849+ val hk : t
850850+ (** Country information for Hong Kong. *)
851851+852852+ val hu : t
853853+ (** Country information for Hungary. *)
854854+855855+ val is : t
856856+ (** Country information for Iceland. *)
857857+858858+ val in' : t
859859+ (** Country information for India. *)
860860+861861+ val id : t
862862+ (** Country information for Indonesia. *)
863863+864864+ val ir : t
865865+ (** Country information for Iran (Islamic Republic of). *)
866866+867867+ val iq : t
868868+ (** Country information for Iraq. *)
869869+870870+ val ie : t
871871+ (** Country information for Ireland. *)
872872+873873+ val im : t
874874+ (** Country information for Isle of Man. *)
875875+876876+ val il : t
877877+ (** Country information for Israel. *)
878878+879879+ val it : t
880880+ (** Country information for Italy. *)
881881+882882+ val jm : t
883883+ (** Country information for Jamaica. *)
884884+885885+ val jp : t
886886+ (** Country information for Japan. *)
887887+888888+ val je : t
889889+ (** Country information for Jersey. *)
890890+891891+ val jo : t
892892+ (** Country information for Jordan. *)
893893+894894+ val kz : t
895895+ (** Country information for Kazakhstan. *)
896896+897897+ val ke : t
898898+ (** Country information for Kenya. *)
899899+900900+ val ki : t
901901+ (** Country information for Kiribati. *)
902902+903903+ val kp : t
904904+ (** Country information for Korea (Democratic People's Republic of). *)
905905+906906+ val kr : t
907907+ (** Country information for Korea Republic of. *)
908908+909909+ val kw : t
910910+ (** Country information for Kuwait. *)
911911+912912+ val kg : t
913913+ (** Country information for Kyrgyzstan. *)
914914+915915+ val la : t
916916+ (** Country information for Lao People's Democratic Republic. *)
917917+918918+ val lv : t
919919+ (** Country information for Latvia. *)
920920+921921+ val lb : t
922922+ (** Country information for Lebanon. *)
923923+924924+ val ls : t
925925+ (** Country information for Lesotho. *)
926926+927927+ val lr : t
928928+ (** Country information for Liberia. *)
929929+930930+ val ly : t
931931+ (** Country information for Libya. *)
932932+933933+ val li : t
934934+ (** Country information for Liechtenstein. *)
935935+936936+ val lt : t
937937+ (** Country information for Lithuania. *)
938938+939939+ val lu : t
940940+ (** Country information for Luxembourg. *)
941941+942942+ val mo : t
943943+ (** Country information for Macao. *)
944944+945945+ val mg : t
946946+ (** Country information for Madagascar. *)
947947+948948+ val mw : t
949949+ (** Country information for Malawi. *)
950950+951951+ val my : t
952952+ (** Country information for Malaysia. *)
953953+954954+ val mv : t
955955+ (** Country information for Maldives. *)
956956+957957+ val ml : t
958958+ (** Country information for Mali. *)
959959+960960+ val mt : t
961961+ (** Country information for Malta. *)
962962+963963+ val mh : t
964964+ (** Country information for Marshall Islands. *)
965965+966966+ val mq : t
967967+ (** Country information for Martinique. *)
968968+969969+ val mr : t
970970+ (** Country information for Mauritania. *)
971971+972972+ val mu : t
973973+ (** Country information for Mauritius. *)
974974+975975+ val yt : t
976976+ (** Country information for Mayotte. *)
977977+978978+ val mx : t
979979+ (** Country information for Mexico. *)
980980+981981+ val fm : t
982982+ (** Country information for Micronesia (Federated States of). *)
983983+984984+ val md : t
985985+ (** Country information for Moldova Republic of. *)
986986+987987+ val mc : t
988988+ (** Country information for Monaco. *)
989989+990990+ val mn : t
991991+ (** Country information for Mongolia. *)
992992+993993+ val me : t
994994+ (** Country information for Montenegro. *)
995995+996996+ val ms : t
997997+ (** Country information for Montserrat. *)
998998+999999+ val ma : t
10001000+ (** Country information for Morocco. *)
10011001+10021002+ val mz : t
10031003+ (** Country information for Mozambique. *)
10041004+10051005+ val mm : t
10061006+ (** Country information for Myanmar. *)
10071007+10081008+ val na : t
10091009+ (** Country information for Namibia. *)
10101010+10111011+ val nr : t
10121012+ (** Country information for Nauru. *)
10131013+10141014+ val np : t
10151015+ (** Country information for Nepal. *)
10161016+10171017+ val nl : t
10181018+ (** Country information for Netherlands. *)
10191019+10201020+ val nc : t
10211021+ (** Country information for New Caledonia. *)
10221022+10231023+ val nz : t
10241024+ (** Country information for New Zealand. *)
10251025+10261026+ val ni : t
10271027+ (** Country information for Nicaragua. *)
10281028+10291029+ val ne : t
10301030+ (** Country information for Niger. *)
10311031+10321032+ val ng : t
10331033+ (** Country information for Nigeria. *)
10341034+10351035+ val nu : t
10361036+ (** Country information for Niue. *)
10371037+10381038+ val nf : t
10391039+ (** Country information for Norfolk Island. *)
10401040+10411041+ val mk : t
10421042+ (** Country information for North Macedonia. *)
10431043+10441044+ val mp : t
10451045+ (** Country information for Northern Mariana Islands. *)
10461046+10471047+ val no : t
10481048+ (** Country information for Norway. *)
10491049+10501050+ val om : t
10511051+ (** Country information for Oman. *)
10521052+10531053+ val pk : t
10541054+ (** Country information for Pakistan. *)
10551055+10561056+ val pw : t
10571057+ (** Country information for Palau. *)
10581058+10591059+ val ps : t
10601060+ (** Country information for Palestine State of. *)
10611061+10621062+ val pa : t
10631063+ (** Country information for Panama. *)
10641064+10651065+ val pg : t
10661066+ (** Country information for Papua New Guinea. *)
10671067+10681068+ val py : t
10691069+ (** Country information for Paraguay. *)
10701070+10711071+ val pe : t
10721072+ (** Country information for Peru. *)
10731073+10741074+ val ph : t
10751075+ (** Country information for Philippines. *)
10761076+10771077+ val pn : t
10781078+ (** Country information for Pitcairn. *)
10791079+10801080+ val pl : t
10811081+ (** Country information for Poland. *)
10821082+10831083+ val pt : t
10841084+ (** Country information for Portugal. *)
10851085+10861086+ val pr : t
10871087+ (** Country information for Puerto Rico. *)
10881088+10891089+ val qa : t
10901090+ (** Country information for Qatar. *)
10911091+10921092+ val re : t
10931093+ (** Country information for Réunion. *)
10941094+10951095+ val ro : t
10961096+ (** Country information for Romania. *)
10971097+10981098+ val ru : t
10991099+ (** Country information for Russian Federation. *)
11001100+11011101+ val rw : t
11021102+ (** Country information for Rwanda. *)
11031103+11041104+ val bl : t
11051105+ (** Country information for Saint Barthélemy. *)
11061106+11071107+ val sh : t
11081108+ (** Country information for Saint Helena Ascension and Tristan da Cunha. *)
11091109+11101110+ val kn : t
11111111+ (** Country information for Saint Kitts and Nevis. *)
11121112+11131113+ val lc : t
11141114+ (** Country information for Saint Lucia. *)
11151115+11161116+ val mf : t
11171117+ (** Country information for Saint Martin (French part). *)
11181118+11191119+ val pm : t
11201120+ (** Country information for Saint Pierre and Miquelon. *)
11211121+11221122+ val vc : t
11231123+ (** Country information for Saint Vincent and the Grenadines. *)
11241124+11251125+ val ws : t
11261126+ (** Country information for Samoa. *)
11271127+11281128+ val sm : t
11291129+ (** Country information for San Marino. *)
11301130+11311131+ val st : t
11321132+ (** Country information for Sao Tome and Principe. *)
11331133+11341134+ val sa : t
11351135+ (** Country information for Saudi Arabia. *)
11361136+11371137+ val sn : t
11381138+ (** Country information for Senegal. *)
11391139+11401140+ val rs : t
11411141+ (** Country information for Serbia. *)
11421142+11431143+ val sc : t
11441144+ (** Country information for Seychelles. *)
11451145+11461146+ val sl : t
11471147+ (** Country information for Sierra Leone. *)
11481148+11491149+ val sg : t
11501150+ (** Country information for Singapore. *)
11511151+11521152+ val sx : t
11531153+ (** Country information for Sint Maarten (Dutch part). *)
11541154+11551155+ val sk : t
11561156+ (** Country information for Slovakia. *)
11571157+11581158+ val si : t
11591159+ (** Country information for Slovenia. *)
11601160+11611161+ val sb : t
11621162+ (** Country information for Solomon Islands. *)
11631163+11641164+ val so : t
11651165+ (** Country information for Somalia. *)
11661166+11671167+ val za : t
11681168+ (** Country information for South Africa. *)
11691169+11701170+ val gs : t
11711171+ (** Country information for South Georgia and the South Sandwich Islands. *)
11721172+11731173+ val ss : t
11741174+ (** Country information for South Sudan. *)
11751175+11761176+ val es : t
11771177+ (** Country information for Spain. *)
11781178+11791179+ val lk : t
11801180+ (** Country information for Sri Lanka. *)
11811181+11821182+ val sd : t
11831183+ (** Country information for Sudan. *)
11841184+11851185+ val sr : t
11861186+ (** Country information for Suriname. *)
11871187+11881188+ val sj : t
11891189+ (** Country information for Svalbard and Jan Mayen. *)
11901190+11911191+ val se : t
11921192+ (** Country information for Sweden. *)
11931193+11941194+ val ch : t
11951195+ (** Country information for Switzerland. *)
11961196+11971197+ val sy : t
11981198+ (** Country information for Syrian Arab Republic. *)
11991199+12001200+ val tw : t
12011201+ (** Country information for Taiwan Province of China. *)
12021202+12031203+ val tj : t
12041204+ (** Country information for Tajikistan. *)
12051205+12061206+ val tz : t
12071207+ (** Country information for Tanzania United Republic of. *)
12081208+12091209+ val th : t
12101210+ (** Country information for Thailand. *)
12111211+12121212+ val tl : t
12131213+ (** Country information for Timor-Leste. *)
12141214+12151215+ val tg : t
12161216+ (** Country information for Togo. *)
12171217+12181218+ val tk : t
12191219+ (** Country information for Tokelau. *)
12201220+12211221+ val to' : t
12221222+ (** Country information for Tonga. *)
12231223+12241224+ val tt : t
12251225+ (** Country information for Trinidad and Tobago. *)
12261226+12271227+ val tn : t
12281228+ (** Country information for Tunisia. *)
12291229+12301230+ val tr : t
12311231+ (** Country information for Turkey. *)
12321232+12331233+ val tm : t
12341234+ (** Country information for Turkmenistan. *)
12351235+12361236+ val tc : t
12371237+ (** Country information for Turks and Caicos Islands. *)
12381238+12391239+ val tv : t
12401240+ (** Country information for Tuvalu. *)
12411241+12421242+ val ug : t
12431243+ (** Country information for Uganda. *)
12441244+12451245+ val ua : t
12461246+ (** Country information for Ukraine. *)
12471247+12481248+ val ae : t
12491249+ (** Country information for United Arab Emirates. *)
12501250+12511251+ val gb : t
12521252+ (** Country information for United Kingdom of Great Britain and Northern Ireland. *)
12531253+12541254+ val us : t
12551255+ (** Country information for United States of America. *)
12561256+12571257+ val um : t
12581258+ (** Country information for United States Minor Outlying Islands. *)
12591259+12601260+ val uy : t
12611261+ (** Country information for Uruguay. *)
12621262+12631263+ val uz : t
12641264+ (** Country information for Uzbekistan. *)
12651265+12661266+ val vu : t
12671267+ (** Country information for Vanuatu. *)
12681268+12691269+ val ve : t
12701270+ (** Country information for Venezuela (Bolivarian Republic of). *)
12711271+12721272+ val vn : t
12731273+ (** Country information for Viet Nam. *)
12741274+12751275+ val vg : t
12761276+ (** Country information for Virgin Islands (British). *)
12771277+12781278+ val vi : t
12791279+ (** Country information for Virgin Islands (U.S.). *)
12801280+12811281+ val wf : t
12821282+ (** Country information for Wallis and Futuna. *)
12831283+12841284+ val eh : t
12851285+ (** Country information for Western Sahara. *)
12861286+12871287+ val ye : t
12881288+ (** Country information for Yemen. *)
12891289+12901290+ val zm : t
12911291+ (** Country information for Zambia. *)
12921292+12931293+ val zw : t
12941294+ (** Country information for Zimbabwe. *)
12951295+end
12961296+12971297+val alpha2_to_country : alpha2 -> Country.t
12981298+val alpha3_to_country : alpha3 -> Country.t
12991299+val numeric_to_country : int -> Country.t
+30
vendor/opam/ISO3166/src/lib/dune
···11+(library
22+ (name ISO3166)
33+ (public_name ISO3166))
44+55+(documentation
66+ (package ISO3166))
77+88+; There's probably a nicer way to do this, but for releasing
99+; or pushing code to the repo, we disable the generation code.
1010+; When developing locally, uncomment the following stanzas.
1111+1212+; (rule
1313+; (alias default)
1414+; (deps ../gen/main.exe)
1515+; (targets ISO3166.ml)
1616+; (mode promote)
1717+; (action
1818+; (with-stdout-to
1919+; ISO3166.ml
2020+; (run ../gen/main.exe))))
2121+2222+; (rule
2323+; (alias default)
2424+; (deps ../gen/main.exe)
2525+; (targets ISO3166.mli)
2626+; (mode promote)
2727+; (action
2828+; (with-stdout-to
2929+; ISO3166.mli
3030+; (run ../gen/main.exe mli))))
+42
vendor/opam/ISO3166/src/lib/index.mld
···11+{1 ISO3166}
22+33+This library provides an interface to the {{: https://www.iso.org/iso-3166-country-codes.html} ISO3166} standard. This defines "country codes".
44+These are short, unique codes that identify a given country. In the ISO3166-1 standard
55+there are three kinds of codes.
66+77+{ul {- {! ISO3166.alpha2}: This is a two-letter country code. }
88+ {- {! ISO3166.alpha3}: This is a three-letter country code. This is usually more closely related to the country's name. }
99+ {- {! ISO3166.numeric}: This is a three-digit country code which is useful for systems using non-Latin scripts. }
1010+}
1111+1212+{2 Usage}
1313+1414+{3 Public APIs}
1515+1616+The library provides a few different ways of interacting with this information. One useful way to use the library
1717+is when wrapping public APIs that might uses [alpha2] to refine access to some resource in a country-specific way.
1818+You might then wish to type this in you OCaml API.
1919+2020+{[
2121+ val get_population : ISO3166.alpha2 -> int
2222+]}
2323+2424+Which might then have an implementation along the lines of:
2525+2626+{[
2727+ let get_population alpha2 =
2828+ Client.get (Endpoint.population ^ "/" ^ ISO3166.alpha2_to_string alpha2)
2929+]}
3030+3131+{3 Low-level Country Information}
3232+3333+The library also encodes all of the country information in the {! ISO3166.Country} module.
3434+This could be used as a way to provide another means to getting country-specific information.
3535+3636+For example, you could extract the numeric code but ask a user to provide a {! ISO3166.Country.t} instead.
3737+3838+{[
3939+ let num_fr = ISO3166.Country.fr |> ISO3166.Country.numeric |> ISO3166.numeric_to_string
4040+]}
4141+4242+In this small example [num_fr] will be ["250"].