Skip to content

Commit

Permalink
Hello, Joe!
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Nov 20, 2024
0 parents commit 0941d68
Show file tree
Hide file tree
Showing 8 changed files with 2,447 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: test

on:
push:
branches:
- master
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "27.1.2"
gleam-version: "1.6.1"
rebar3-version: "3"
# elixir-version: "1.15.4"
- run: gleam deps download
- run: gleam test --target erlang
- run: gleam test --target javascript
- run: gleam format --check src test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.beam
*.ez
/build
erl_crash.dump
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v1.0.0 - 2024-11-20

- Initial release! Extracted from `gleam_stdlib` v0.43.0
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Yielder

Unfold values on-demand from a function.

[![Package Version](https://img.shields.io/hexpm/v/gleam_yielder)](https://hex.pm/packages/gleam_yielder)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/gleam_yielder/)

```sh
gleam add gleam_yielder@1
```
```gleam
import gleam/yielder
pub fn main() {
yielder.unfold(2, fn(acc) { yielder.Next(acc, acc * 2) })
|> yielder.take(5)
|> yielder.to_list
// -> [2, 4, 8, 16, 32]
}
```

Further documentation can be found at <https://hexdocs.pm/gleam_yielder>.
16 changes: 16 additions & 0 deletions gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "gleam_yielder"
version = "1.0.0"
gleam = ">= 0.32.0"
licences = ["Apache-2.0"]
description = "Unfold values on-demand from a function"

repository = { type = "github", user = "gleam-lang", repo = "yielder" }
links = [
{ title = "Sponsor", href = "https://github.com/sponsors/lpil" },
]

[dependencies]
gleam_stdlib = ">= 0.34.0 and < 2.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
11 changes: 11 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
{ name = "gleam_stdlib", version = "0.43.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "69EF22E78FDCA9097CBE7DF91C05B2A8B5436826D9F66680D879182C0860A747" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
]

[requirements]
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
Loading

0 comments on commit 0941d68

Please sign in to comment.