MyNixOS website logo
Description

A collection of standards representable by simple data types.

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

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:

  • ISO 3166-1 (Data.Standards.ISO.Country.Primary)

    • alpha-2 (Data.Standards.ISO.Country.Primary.Alpha2)
    • alpha-3 (Data.Standards.ISO.Country.Primary.Alpha3)
    • numeric (Data.Standards.ISO.Country.Primary.Numeric)
Metadata

Version

0.1.0.2

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows