ranger

package module
v0.0.0-...-dcf18f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 0 Imported by: 0

README

ranger

A repo for playing with the ability to range over functions in Go.

This is as alpha as alpha can be. I reserve the right to even change the repo name, let alone API stability. (The underlying functionality isn't even stable.)

You will need to be on gotip 510541 for this (or some subsequent release). See this post, under "Trying This Proposal Today".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntRange

func IntRange(r int) func(func(int, int) bool) bool

IntRange turns a range on an int into a component that can be used in functional range pipelines.

func RangeOver

func RangeOver(start, stop, jump int) func(func(int) bool) bool

func Take

func Take[K, V any](num int, f func(func(K, V) bool) bool) func(func(K, V) bool) bool

Take wraps a push iterator with a function that will either take the given integer number of values and stop, or stop when the underlying sequence stops.

No special treatment for zero or negative numbers, both of which will empty the sequence.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL