slices

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package slices contains a collection of helpful generic functions for working with slices. It is currently not part of the public interface and must be consider as highly instable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy[T any](slice []T) []T

Copy makes a shallow copy of the given slice.

func Permute

func Permute[T any](slice []T) [][]T

Permute permutates the given slice as is.

func PermuteDo

func PermuteDo[T any](slice []T, do func([]T), i int)

PermuteDo permutates the given slice starting at the position given by the index and call the `do` function on each permutation to collect the result. For a full permutation the `index` must start with `0`.

func Reverse

func Reverse[T any](slice []T) []T

Reverse reverses the given slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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