-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Country data type and functions
--   
--   The <a>country</a> library provides a data type for dealing with the
--   set of countries as defined by ISO 3166. The representation is compact
--   and is well-suited to use with vectors and primitive arrays.
--   Additionally, this library exports functions that provide the
--   following encodings and decodings:
--   
--   <ul>
--   <li>ISO Alpha-2 (two-letter country code)</li>
--   <li>ISO Alpha-3 (three-letter country code)</li>
--   <li>ISO Numeric (three-digit country code)</li>
--   </ul>
--   
--   Please open up an issue on github if there is anything you would like
--   to see added.
@package country
@version 0.1.6


-- | This module provides the data constructor for a <a>Country</a>. While
--   pattern matching on a country is perfectly safe, constructing one is
--   not. There is an invariant the type system does not capture that the
--   country number, as defined by ISO 3166-1, is between the inclusive
--   bounds 0 and 999. Failure to maintain this invariant can cause other
--   functions in this library to segfault.
module Country.Unsafe

-- | A country recognized by ISO 3166.
newtype Country
Country :: Word16 -> Country

module Country.Identifier
afghanistan :: Country
ålandIslands :: Country
albania :: Country
algeria :: Country
americanSamoa :: Country
andorra :: Country
angola :: Country
anguilla :: Country
antarctica :: Country
antiguaAndBarbuda :: Country
argentina :: Country
armenia :: Country
aruba :: Country
australia :: Country
austria :: Country
azerbaijan :: Country
bahamas :: Country
bahrain :: Country
bangladesh :: Country
barbados :: Country
belarus :: Country
belgium :: Country
belize :: Country
benin :: Country
bermuda :: Country
bhutan :: Country
boliviaPlurinationalStateOf :: Country
bonaireSintEustatiusAndSaba :: Country
bosniaAndHerzegovina :: Country
botswana :: Country
bouvetIsland :: Country
brazil :: Country
britishIndianOceanTerritory :: Country
bruneiDarussalam :: Country
bulgaria :: Country
burkinaFaso :: Country
burundi :: Country
cambodia :: Country
cameroon :: Country
canada :: Country
caboVerde :: Country
caymanIslands :: Country
centralAfricanRepublic :: Country
chad :: Country
chile :: Country
china :: Country
christmasIsland :: Country
cocosKeelingIslands :: Country
colombia :: Country
comoros :: Country
congo :: Country
congoDemocraticRepublicOfThe :: Country
cookIslands :: Country
costaRica :: Country
côteDIvoire :: Country
croatia :: Country
cuba :: Country
curaçao :: Country
cyprus :: Country
czechRepublic :: Country
denmark :: Country
djibouti :: Country
dominica :: Country
dominicanRepublic :: Country
ecuador :: Country
egypt :: Country
elSalvador :: Country
equatorialGuinea :: Country
eritrea :: Country
estonia :: Country
ethiopia :: Country
falklandIslandsMalvinas :: Country
faroeIslands :: Country
fiji :: Country
finland :: Country
france :: Country
frenchGuiana :: Country
frenchPolynesia :: Country
frenchSouthernTerritories :: Country
gabon :: Country
gambia :: Country
georgia :: Country
germany :: Country
ghana :: Country
gibraltar :: Country
greece :: Country
greenland :: Country
grenada :: Country
guadeloupe :: Country
guam :: Country
guatemala :: Country
guernsey :: Country
guinea :: Country
guineaBissau :: Country
guyana :: Country
haiti :: Country
heardIslandAndMcdonaldIslands :: Country
holySee :: Country
honduras :: Country
hongKong :: Country
hungary :: Country
iceland :: Country
india :: Country
indonesia :: Country
iranIslamicRepublicOf :: Country
iraq :: Country
ireland :: Country
isleOfMan :: Country
israel :: Country
italy :: Country
jamaica :: Country
japan :: Country
jersey :: Country
jordan :: Country
kazakhstan :: Country
kenya :: Country
kiribati :: Country
koreaDemocraticPeopleSRepublicOf :: Country
koreaRepublicOf :: Country
kuwait :: Country
kyrgyzstan :: Country
laoPeopleSDemocraticRepublic :: Country
latvia :: Country
lebanon :: Country
lesotho :: Country
liberia :: Country
libya :: Country
liechtenstein :: Country
lithuania :: Country
luxembourg :: Country
macao :: Country
macedoniaTheFormerYugoslavRepublicOf :: Country
madagascar :: Country
malawi :: Country
malaysia :: Country
maldives :: Country
mali :: Country
malta :: Country
marshallIslands :: Country
martinique :: Country
mauritania :: Country
mauritius :: Country
mayotte :: Country
mexico :: Country
micronesiaFederatedStatesOf :: Country
moldovaRepublicOf :: Country
monaco :: Country
mongolia :: Country
montenegro :: Country
montserrat :: Country
morocco :: Country
mozambique :: Country
myanmar :: Country
namibia :: Country
nauru :: Country
nepal :: Country
netherlands :: Country
newCaledonia :: Country
newZealand :: Country
nicaragua :: Country
niger :: Country
nigeria :: Country
niue :: Country
norfolkIsland :: Country
northernMarianaIslands :: Country
norway :: Country
oman :: Country
pakistan :: Country
palau :: Country
palestineStateOf :: Country
panama :: Country
papuaNewGuinea :: Country
paraguay :: Country
peru :: Country
philippines :: Country
pitcairn :: Country
poland :: Country
portugal :: Country
puertoRico :: Country
qatar :: Country
réunion :: Country
romania :: Country
russianFederation :: Country
rwanda :: Country
saintBarthélemy :: Country
saintHelenaAscensionAndTristanDaCunha :: Country
saintKittsAndNevis :: Country
saintLucia :: Country
saintMartinFrenchPart :: Country
saintPierreAndMiquelon :: Country
saintVincentAndTheGrenadines :: Country
samoa :: Country
sanMarino :: Country
saoTomeAndPrincipe :: Country
saudiArabia :: Country
senegal :: Country
serbia :: Country
seychelles :: Country
sierraLeone :: Country
singapore :: Country
sintMaartenDutchPart :: Country
slovakia :: Country
slovenia :: Country
solomonIslands :: Country
somalia :: Country
southAfrica :: Country
southGeorgiaAndTheSouthSandwichIslands :: Country
southSudan :: Country
spain :: Country
sriLanka :: Country
sudan :: Country
suriname :: Country
svalbardAndJanMayen :: Country
swaziland :: Country
sweden :: Country
switzerland :: Country
syrianArabRepublic :: Country
taiwanProvinceOfChina :: Country
tajikistan :: Country
tanzaniaUnitedRepublicOf :: Country
thailand :: Country
timorLeste :: Country
togo :: Country
tokelau :: Country
tonga :: Country
trinidadAndTobago :: Country
tunisia :: Country
turkey :: Country
turkmenistan :: Country
turksAndCaicosIslands :: Country
tuvalu :: Country
uganda :: Country
ukraine :: Country
unitedArabEmirates :: Country
unitedKingdomOfGreatBritainAndNorthernIreland :: Country
unitedStatesOfAmerica :: Country
unitedStatesMinorOutlyingIslands :: Country
uruguay :: Country
uzbekistan :: Country
vanuatu :: Country
venezuelaBolivarianRepublicOf :: Country
vietNam :: Country
virginIslandsBritish :: Country
virginIslandsUS :: Country
wallisAndFutuna :: Country
westernSahara :: Country
yemen :: Country
zambia :: Country
zimbabwe :: Country
kosovo :: Country

module Country

-- | A country recognized by ISO 3166.
data Country

-- | Convert a country to its numeric code. This is a three-digit number
--   and will consequently be less than 1000.
encodeNumeric :: Country -> Word16

-- | Get a country from a numeric code. Any code greater than 999 will not
--   have a country associated with it. Additionally, many codes are
--   unassigned.
decodeNumeric :: Word16 -> Maybe Country

-- | The name of a country given in English
encodeEnglish :: Country -> Text

-- | Parse a country from its name. This function is language-agnostic and
--   is very generous with what it accepts. It handles official names,
--   colloquial names, acroynms, and obsolete names for many countries. It
--   strives to handle any source language. Open an issue on the issue
--   tracker if their are names that are missing.
decode :: Text -> Maybe Country
decodeUtf8 :: ByteString -> Maybe Country

-- | Parse a country from its name using an attoparsec text parser. This
--   function is language-agnostic and can handle any source language. In
--   the case that one possible country name is a prefix of another
--   possible name (for example, United States vs United States of
--   America), the longest possible will be parsed.
parser :: Parser Country
parserUtf8 :: Parser Country

-- | The alpha-2 country code, uppercase
alphaTwoUpper :: Country -> Text

-- | The alpha-3 country code, uppercase
alphaThreeUpper :: Country -> Text

-- | The alpha-3 country code, lowercase
alphaThreeLower :: Country -> Text

-- | The alpha-2 country code, lowercase
alphaTwoLower :: Country -> Text
decodeAlphaTwo :: Text -> Maybe Country
decodeAlphaThree :: Text -> Maybe Country
