collection

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package collection provides bounded, deterministic collection operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk(values []any, size int) ([][]any, error)

Chunk splits values into ordered, non-empty chunks of at most size elements.

func Cumsum

func Cumsum(values []any) ([]float64, error)

Cumsum returns the finite running sum of numeric values.

func Diff

func Diff(values []any) ([]float64, error)

Diff returns finite adjacent differences of numeric values.

func Difference

func Difference(left, right []any) ([]any, error)

Difference returns unique values from left that are absent from right.

func Intersection

func Intersection(left, right []any) ([]any, error)

Intersection returns unique values present in both inputs, preserving left order.

func Lag

func Lag(values []any, periods int) ([]any, error)

Lag shifts values by periods and fills the leading positions with nil.

func Merge

func Merge(left, right map[string]any) (map[string]any, error)

Merge copies two objects, with keys from right replacing keys from left.

func Options

func Options() []exprlib.Option

Options returns the Expr registrations for collection helpers.

func Union

func Union(left, right []any) ([]any, error)

Union returns unique values from left followed by unique values from right.

func Zip

func Zip(left, right []any) ([][]any, error)

Zip pairs values at matching positions and requires equal-length inputs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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