Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smores56/roc-semver
Roc implementation of Semantic Versioning
https://github.com/smores56/roc-semver
roc-lang semver
Last synced: 3 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 (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-11T08:58:43.000Z (5 months ago)
- Last Synced: 2024-06-14T02:21:12.148Z (5 months ago)
- Topics: roc-lang, semver
- Language: Roc
- Homepage: https://smores56.github.io/roc-semver/
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- 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,
preRelease: ["alpha", "beta"],
build: ["build--"],
}expect
when (versionRes, versionReqRes) is
(Ok version, Ok versionReq) ->
versionReq |> VersionReq.matches version_other -> Bool.false
```