package dose3

  1. Overview
  2. Docs

this functions follow the semantic versioning specification http://semver.org/

type raw_version = string * string * string * string list * string list

Raw version components. Raw versions are not strictly semantic versions, but can also contains characters as 'x' and 'X' . Raw versions must be converted to semantic versions.

type ident =
  1. | S of string
  2. | N of int
type version = {
  1. major : int;
  2. minor : int;
  3. patch : int;
  4. pre : ident list;
  5. build : string list;
}
val parse_raw_version : string -> raw_version

Parses a string into a version. Fail if the version can not be parsed

val parse_version : string -> version

Parses a string into a version. Fail if the version can not be parsed

val convert : raw_version -> version

Raise Failure if the string cannot be converted

val compose : version -> string

recompose a version string. For all v: equal(v,compose(parse_version v)) = true. There may, however, be small syntactic differences between v and compose(parse_version v)

val compare_version : version -> version -> int

Compare two versions. Raw versions must be converted to be compared

val compare : string -> string -> int

Compare two versions. Fail if one of the versions cannot be parsed or compared

val equal : string -> string -> bool

Equality between two versions