SemVer

Parser which allows to deal with Semantic Versioning (SemVer). Make sure to read the documentation in the SemVerInfo record as well if you manually create versions.

Functions and values

Function or valueDescription
SemVer.expand delimiter text
Signature: delimiter:char list -> text:string -> string list

Splits the given version string by possible delimiters but keeps them as parts of resulting list.

SemVer.isValid(version)
Signature: version:string -> bool

Returns true if input appears to be a parsable semver string

SemVer.parse(version)
Signature: version:string -> SemVerInfo

Parses the given version string into a SemVerInfo which can be printed using ToString() or compared according to the rules described in the SemVer docs.

Sample

1: 
2: 
3: 
4: 
5: 
parse "1.0.0-rc.1"     < parse "1.0.0"          // true
parse "1.2.3-alpha"    > parse "1.2.2"          // true
parse "1.2.3-alpha2"   > parse "1.2.3-alpha"    // true
parse "1.2.3-alpha002" > parse "1.2.3-alpha1"   // false
parse "1.5.0-beta.2"   > parse "1.5.0-rc.1"     // false
SemVer.validContent
Signature: Regex

Active patterns

Active patternDescription
SemVer.( |Big|_| )(str)
Signature: str:string -> BigInteger option

Matches if str is convertible to big int and not less than zero, and returns the bigint value.

SemVer.( |Int|_| )(str)
Signature: str:string -> int option

Matches if str is convertible to Int and not less than zero, and returns the value as UInt.