Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/massivefermion/ranger
https://github.com/massivefermion/ranger
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/massivefermion/ranger
- Owner: massivefermion
- License: apache-2.0
- Created: 2023-03-27T15:04:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-24T06:43:51.000Z (about 1 month ago)
- Last Synced: 2024-11-24T07:27:14.258Z (about 1 month ago)
- Language: Gleam
- Homepage: https://hex.pm/packages/ranger
- Size: 883 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![ranger](https://raw.githubusercontent.com/massivefermion/ranger/main/banner.png)
[![Package Version](https://img.shields.io/hexpm/v/ranger)](https://hex.pm/packages/ranger)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/ranger/)# ranger
create ranges over any type
## Quick start
```sh
gleam test # Run the tests
gleam shell # Run an Erlang shell
```## Installation
This package can be added to your Gleam project:
```sh
gleam add ranger
```and its documentation can be found at .
## Usage
```gleam
import gleam/float
import rangerpub fn main() {
let range =
ranger.create(
validate: fn(_) { True },
negate_step: fn(s) { -1.0 *. s },
add: fn(a, b) { a +. b },
compare: float.compare,
)let assert Ok(z_to_p) = range("z", "p", 1)
z_to_p
|> iterator.to_list
}
```