functional

package
v0.0.0-...-e49a3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package functional provides functional utilities for commonly done operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map[V any, R any](slice []V, mapper func(entry V) R) []R

Map applies the mapper function to each entry in the slice and returns a new slice with the results.

func MapFilter

func MapFilter[V any, R comparable](slice []V, mapper func(entry V) R) []R

MapFilter applies the mapper function to each entry in the slice and returns a new slice with the results.

If mapper returns the default value for the R type, the result is not added to the returned slice.

func ToString

func ToString[T stringer](v T) string

ToString is a function useful to pass into a mapper, to map all values to a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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