MyNixOS website logo
Description

Hydrogen Version Type.

A sane replacement for Data.Version from the base package.

Hydrogen.Version is also exported by Hydrogen.Prelude where it comes with a few more instances (e.g. for Data.Serialize).

>>> Differences to Data.Version
Sane Ord instance

Data.Version relies on Ord for lists, which will consider 1.0 to be less than 1.0.0. Hydrogen.Version considers these to be equal.

Sane Read and Show instances

With Hydrogen.Version you can just do read "1.0.0" :: Version, whereas the Read and Show instances for Data.Version do not give a concise representation:

show hydrogenVersion == "1.0.0"
show dataVersion == "Version versionBranch = [1,0,0], versionTags = []"
Stricter API

In Hydrogen.Version you can create a Version only via mkVersion, whereas in Data.Version the constructor is exported, thus you could so such nonsense as Data.Version.Version [] [] (which is not a proper version at all).

No Tags

Hydrogen.Version does not support tags. This is intentional, since there is no agreed upon definition for Ord in the presence of tags (consider alpha vs beta vs snapshot vs ga vs ...).

hydrogen-version

Build Status

A sane replacement for Data.Version from the base package.

Note:Version is also exported by Hydrogen.Prelude, where it comes with some more instances (like Serialize).

Data.Version vs Hydrogen.Version

Sane Ord instance

Data.Version relies on Ord for lists, which will consider 1.0 to be less than 1.0.0. Hydrogen.Version considers these to be equal.

Sane Read and Show instances

With Hydrogen.Version you can just do read "1.0.0" :: Version, whereas the Read and Show instances for Data.Version do not give a concise representation (show dataVersion == "Version {versionBranch = [1,0], versionTags = []}").

Stricter API

In Hydrogen.Version you can create a Version only via mkVersion, whereas in Data.Version the constructor is exported, thus you could do such nonsense as Data.Version.Version [] [] (which is not a proper version at all).

No Tags

Hydrogen.Version does not support tags. This is intentional, since there is no agreed upon definition for Ord in the presence of tags (consider alpha vs beta vs snapshot vs ga vs ...).

Metadata

Version

1.4

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