Semver
Semver
implements semantic versions for Carp.
Semantic versions are composed of a major, minor, and patch version, and might
optionally have a tag.
Installation
(load "https://github.com/carpentry-org/semver@0.0.6")
<
defn
(Fn [(Ref Semver a), (Ref Semver a)] Bool)
(< a b)
=
defn
(Fn [(Ref Semver a), (Ref Semver a)] Bool)
(= o1 o2)
>
defn
(Fn [a, a] Bool)
(> a b)
copy
instantiate
(Fn [(Ref Semver a)] Semver)
copies a Semver
.
from-string
defn
(Fn [(Ref String a)] (Maybe Semver))
(from-string s)
init
instantiate
(Fn [Int, Int, Int, (Maybe String)] Semver)
creates a Semver
.
major
instantiate
(Fn [(Ref Semver a)] (Ref Int a))
gets the major
property of a Semver
.
minor
instantiate
(Fn [(Ref Semver a)] (Ref Int a))
gets the minor
property of a Semver
.
patch
instantiate
(Fn [(Ref Semver a)] (Ref Int a))
gets the patch
property of a Semver
.
prn
instantiate
(Fn [(Ref Semver a)] String)
converts a Semver
to a string.
set-major
instantiate
(Fn [Semver, Int] Semver)
sets the major
property of a Semver
.
set-major!
instantiate
(Fn [(Ref Semver a), Int] ())
sets the major
property of a Semver
in place.
set-minor
instantiate
(Fn [Semver, Int] Semver)
sets the minor
property of a Semver
.
set-minor!
instantiate
(Fn [(Ref Semver a), Int] ())
sets the minor
property of a Semver
in place.
set-patch
instantiate
(Fn [Semver, Int] Semver)
sets the patch
property of a Semver
.
set-patch!
instantiate
(Fn [(Ref Semver a), Int] ())
sets the patch
property of a Semver
in place.
set-tag
instantiate
(Fn [Semver, (Maybe String)] Semver)
sets the tag
property of a Semver
.
set-tag!
instantiate
(Fn [(Ref Semver a), (Maybe String)] ())
sets the tag
property of a Semver
in place.
str
instantiate
(Fn [(Ref Semver a)] String)
converts a Semver
to a string.
tag
instantiate
(Fn [(Ref Semver a)] (Ref (Maybe String) a))
gets the tag
property of a Semver
.
update-major
instantiate
(Fn [Semver, (Ref (Fn [Int] Int a) b)] Semver)
updates the major
property of a Semver
using a function f
.
update-minor
instantiate
(Fn [Semver, (Ref (Fn [Int] Int a) b)] Semver)
updates the minor
property of a Semver
using a function f
.
update-patch
instantiate
(Fn [Semver, (Ref (Fn [Int] Int a) b)] Semver)
updates the patch
property of a Semver
using a function f
.
update-tag
instantiate
(Fn [Semver, (Ref (Fn [(Maybe String)] (Maybe String) a) b)] Semver)
updates the tag
property of a Semver
using a function f
.
zero
defn
(Fn [] Semver)
(zero)