infiniyield/README.md
Lily Rose 52df93ed93
Some checks are pending
test / test (push) Waiting to run
Remove unnecessary development section from README
2025-08-09 18:43:15 +10:00

537 B

infiniyield

Infinitely unfold values on-demand from a function.

Package Version Hex Docs

gleam add infiniyield@1
import infiniyield

pub fn main() {
  infiniyield.unfold(2, fn(acc) { yielder.Next(acc, acc * 2) })
  |> infiniyield.take(5)
  // -> [2, 4, 8, 16, 32]
}

Further documentation can be found at https://hexdocs.pm/infiniyield.