country: Country data type and functions

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

The country 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: . * ISO Alpha-2 (two-letter country code) . * ISO Alpha-3 (three-letter country code) . * ISO Numeric (three-digit country code) . . The main differences between this library and `iso3166-country-codes` are: . * it doesn't use an ADT to represent countries, instead it uses the country's three-digit country code. . * it doesn't use String for encoding/decoding . * it provides two-alpha and three-alpha country codes. . * it provides Prim instances from the primitive package to allow types to be used in unboxed vectors/arrays. . * BSD3 licence instead of LGPL . Please open up an issue on github if there is anything you would like to see added.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.3.1, 0.2.4.0, 0.2.4.1, 0.2.4.2, 0.2.5.0
Change log CHANGELOG.md
Dependencies aeson (>=1.2 && <2.3), attoparsec (>=0.13 && <0.15), base (>=4.9 && <5), bytebuild (>=0.3.4 && <0.4), bytehash (>=0.1.1 && <0.2), byteslice (>=0.2.3 && <0.3), bytestring (>=0.10), contiguous (>=0.6.1), deepseq (>=1.3.0.2 && <1.6), hashable (>=1.2 && <1.6), primitive (>=0.6.4 && <0.10), primitive-unlifted (>=2.1), scientific (>=0.3 && <0.4), text (>=2.0 && <2.2), text-short (>=0.1.3), unordered-containers (>=0.2 && <0.3) [details]
Tested with ghc ==9.4.8 || ==9.6.3 || ==9.8.1
License BSD-3-Clause
Copyright 2017 Andrew Martin
Author Andrew Martin
Maintainer amartin@layer3com.com
Category Web
Home page https://github.com/byteverse/country
Bug tracker https://github.com/byteverse/country/issues
Source repo head: git clone git://github.com/byteverse/country.git
Uploaded by chessai at 2024-12-11T18:47:50Z
Distributions LTSHaskell:0.2.5.0, NixOS:0.2.4.2, Stackage:0.2.5.0
Reverse Dependencies 4 direct, 2 indirect [details]
Downloads 8033 total (74 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-12-11 [all 1 reports]

Readme for country-0.2.5.0

[back to package description]

country

This is a mega-repo with two projects:

  • country: A library for dealing with countries, country codes, etc.
  • country-code-generation: An executable that generates some of the source code in country. It converts both countries.csv and aliases.txt into lists of tuples.

Build Instructions

Some of source code in the country library is generated. To generate this code, the country-code-generation application reads the top-level aliases.txt and countries.csv file and outputs source Haskell. If neither of these two files have been modified, then it is not necessary to run country-code-generation. A cabal.project file is used to build two targets. From the project root, run:

cabal build country-code-generation
/home/jdoe/path/to/projects/country/.../country-code-generation
cabal build country