Hydrogen Version Type https://scravy.de/hydrogen-version/

Latest on Hackage:1.4

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed by Julian Fleischer
Maintained by julian@scravy.de


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



  • Initial release


  • Fixed Read instance


  • Added instance for Generic


  • Added instance for Typeable


  • Added fromDataVersion
  • Added toDataVersion
Depends on 1 package:
Used by 1 package:
comments powered byDisqus