slices

package
v0.0.0-...-1f40f5c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mapped

func Mapped[S ~[]A, A, B any](s S, f func(int, A) B) iter.Seq[B]

func MappedValues

func MappedValues[S ~[]A, A, B any](s S, f func(A) B) iter.Seq[B]
Example
package main

import (
	"fmt"

	"codeberg.org/FedericoSchonborn/go-sandbox/iter/slices"
)

func main() {
	for i := range slices.MappedValues([]int{1, 2, 3}, func(i int) int { return i + 1 }) {
		fmt.Println(i)
	}

}
Output:


2
3
4

Types

This section is empty.

Jump to

Keyboard shortcuts

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