Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Country
- encodeNumeric :: Country -> Word16
- decodeNumeric :: Word16 -> Maybe Country
- encodeEnglish :: Country -> Text
- decode :: Text -> Maybe Country
- alphaTwoUpper :: Country -> Text
- alphaThreeUpper :: Country -> Text
- alphaThreeLower :: Country -> Text
- alphaTwoLower :: Country -> Text
- decodeAlphaTwo :: Text -> Maybe Country
- decodeAlphaThree :: Text -> Maybe Country
Documentation
A country recognized by ISO 3166.
Three digit code
encodeNumeric :: Country -> Word16 Source #
Convert a country to its numeric code. This is a three-digit number and will consequently be less than 1000.
decodeNumeric :: Word16 -> Maybe Country Source #
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.
Name
encodeEnglish :: Country -> Text Source #
The name of a country given in English
decode :: Text -> Maybe Country Source #
Parse a country from its name. This function is language-agnostic. It can handle any source language.
Alpha-2 and Alpha-3
alphaTwoUpper :: Country -> Text Source #
The alpha-2 country code, uppercase
alphaThreeUpper :: Country -> Text Source #
The alpha-3 country code, uppercase
alphaThreeLower :: Country -> Text Source #
The alpha-3 country code, lowercase
alphaTwoLower :: Country -> Text Source #
The alpha-2 country code, lowercase