SemanticVersion

Semantic versions consist of three numbers, each having a specific meaning. This module makes no attempt to enforce the semantic versioning rules.

type alias SemanticVersion = { major : Int, minor : Int, patch : Int }

A semantic version has three numbers, separated by a period.

  • major signifies API compatibility. Two version with different major numbers, are likely incompatible.
  • minor represents additions. 1.0.0 should be compatible with 1.1.0, but not the other way around.
  • patch represents bug fixes. 1.0.0 and 1.0.1 has the same API, but the latter might be more stable.

Constructors

fromString : String -> Maybe SemanticVersion

Convert a String into a SemanticVersion.

cliParser : ValueParser SemanticVersion

A parser for use with CLI.Parser.

jsonDecoder : Decoder SemanticVersion

Decode SemanticVersion from JSON.

Queries

compare : SemanticVersion -> SemanticVersion -> Order

Compare two SemanticVersion.

Conversions

toString : SemanticVersion -> String

Turn a SemanticVersion into a String.

toJson : SemanticVersion -> Value

Turn a SemanticVersion into Json.