The hydrogen-version package

[Tags:library, mit]

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 ...).

[Skip to Readme]

Properties

Versions 1.0, 1.0.1, 1.1, 1.2, 1.3, 1.4 (info)
Change log CHANGELOG.md
Dependencies base (==4.*), ghc-prim [details]
License MIT
Author Julian Fleischer
Maintainer julian@scravy.de
Category Language
Home page https://scravy.de/hydrogen-version/
Source repository head: git clone https://github.com/scravy/hydrogen-version
Uploaded Thu Mar 26 06:26:52 UTC 2015 by JulianFleischer
Distributions NixOS:1.4
Downloads 1047 total (17 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-03-26 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for hydrogen-version

Readme for hydrogen-version-1.4

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 ...).