-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Francesconi
committed
Apr 12, 2022
1 parent
155b5ed
commit 4bd9498
Showing
2 changed files
with
188 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
# go-rampart | ||
|
||
![github.com/francesconi/go-rampart](https://github.com/francesconi/go-rampart/workflows/test/badge.svg) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/francesconi/go-rampart)](https://goreportcard.com/report/github.com/francesconi/go-rampart) | ||
|
||
Go port of the [Haskell Rampart library](https://github.com/tfausak/rampart) by [Taylor Fausak](https://taylor.fausak.me/2020/03/13/relate-intervals-with-rampart). | ||
|
||
![][interval relations] | ||
This package provides types and functions for defining intervals and determining how they relate to each other. This can be useful to determine if and how two ordinal types overlap. | ||
|
||
## Install | ||
|
||
```sh | ||
go get github.com/francesconi/go-rampart | ||
``` | ||
|
||
## Examples | ||
## Example | ||
|
||
```go | ||
a := rampart.NewInterval(2, 3) | ||
b := rampart.NewInterval(3, 7) | ||
rel := a.Relate(b) // RelationMeets | ||
rel := a.Relate(b) | ||
// rel: RelationMeets | ||
``` | ||
|
||
![][interval relations] | ||
|
||
[interval relations]: ./docs/interval-relations.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters