https://github.com/smores56/roc-semver
Roc implementation of Semantic Versioning
https://github.com/smores56/roc-semver
roc-lang semver
Last synced: 2 months ago
JSON representation
Roc implementation of Semantic Versioning
- Host: GitHub
- URL: https://github.com/smores56/roc-semver
- Owner: smores56
- Created: 2024-06-09T04:12:59.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-20T18:55:18.000Z (3 months ago)
- Last Synced: 2025-03-06T23:43:15.934Z (3 months ago)
- Topics: roc-lang, semver
- Language: Roc
- Homepage: https://smores56.github.io/roc-semver/
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- roc-awesome - smores56/roc-semver
README
roc-semver
==========A [Roc](https://roc-lang.org) implementation of [semver 2.0.0](https://semver.org/).
Many thanks to the [Rust](https://rust-lang.org) implementation [here](https://github.com/dtolnay/semver)
by David Tolnay.## Example
```roc
import semver.Semver
import semver.VersionReqversionRes = Semver.parse "1.2.3-alpha.beta+build--"
versionReqRes = VersionReq.parse ">=1.2.3-alpha.beta, <2"expect
versionRes == Ok {
major: 1,
minor: 2,
patch: 3,
pre_release: ["alpha", "beta"],
build: ["build--"],
}expect
when (versionRes, versionReqRes) is
(Ok version, Ok versionReq) ->
versionReq |> VersionReq.matches version_other -> Bool.false
```