https://github.com/massivefermion/ranger
https://github.com/massivefermion/ranger
Last synced: 4 months 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 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-18T06:36:16.000Z (7 months ago)
- Last Synced: 2025-01-25T05:08:56.552Z (6 months ago)
- Language: Gleam
- Homepage: https://hex.pm/packages/ranger
- Size: 889 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://hex.pm/packages/ranger)
[](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/int
import gleam/yielderimport ranger
pub fn main() {
let range =
ranger.create(
validate: fn(_) { True },
negate_step: fn(s) { -1 * s },
add: fn(a, b) { a + b },
compare: int.compare,
)let assert Ok(ten_to_five) = range(10, 5, 1)
ten_to_five
|> yielder.to_list
}
```