data-standards: A collection of standards representable by simple data types.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Type-safe representations of the country codes described by the ISO 3166-1 specification.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.1.0.1, 0.1.0.2
Change log ChangeLog.md
Dependencies base (>=4.9 && <4.10), hashable (>=1.2 && <1.3), unordered-containers (<0.3) [details]
License MPL-2.0
Copyright (c) 2018 Samuel May
Author Samuel May
Maintainer ag.eitilt@gmail.com
Category Data
Home page https://github.com/ag-eitilt/data-standards
Bug tracker https://github.com/ag-eitilt/data-standards/issues
Source repo head: git clone git://github.com/ag-eitilt/data-standards.git
this: git clone git://github.com/ag-eitilt/data-standards.git(tag v0.1.0.0)
Uploaded by ageitilt at 2018-07-07T04:27:09Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for data-standards-0.1.0.0

[back to package description]

A number of the ISO standards are particularly attractive to being implemented as static data libraries: they describe short strings that are prone to error if left as 'Text', but are large enough to strongly discourage rewriting them for each project. It is no surprise, therefore, that this package is the fourth on Hackage to implement ISO 3166-1:

However, none of those options truly seemed to provide an ideal, /complete/ experience. Only one (country) provides all three code encodings, but it doesn't expose constructors for pattern matching. None of them implement the other two parts of ISO 3166 (region codes, and historic countries), and the only package that makes an effort to do so ("Data.StateCodes" from state-codes) doesn't cover anything beyond the US. Someone who only needs the alpha-2 codes ("CA") may indeed find one of the existing packages sufficient, but for anyone who does need the full power of ISO 3166-2, none of them would serve.

The lack of people who would actually find this useful is another matter. (Eight packages using the simple alpha-2 codes from one or another of the above, as of writing.)

This package is an attempt to package that standard -- and, eventually, others like it -- in a consistent API based in standard Haskell; fromEnum rather than encodeNumeric, for example.

The following standards are implemented: