collection

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 7 Imported by: 0

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