Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
checks:
strategy:
matrix:
go-version: ['1.23', '1.24']
go-version: ['1.25', '1.26']
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -27,7 +27,7 @@ jobs:
test:
strategy:
matrix:
go-version: ['1.23', '1.24']
go-version: ['1.25', '1.26']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
30 changes: 30 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Go library (`github.com/freeformz/seq`) providing functional iterator/sequence utilities built on Go's `iter.Seq[T]` and `iter.Seq2[K,V]` types. Requires Go 1.24+. Zero external dependencies. Single package, single source file (`seq.go`).

## Commands

```bash
# Test (with race detector)
go test -v -race ./...

# Lint
go vet ./...
go install honnef.co/go/tools/cmd/staticcheck@latest && staticcheck ./...
```

## Architecture & Conventions

**Dual API pattern**: Most functions have two variants — one for `iter.Seq[T]` and a `KV` suffix version for `iter.Seq2[K,V]`. The `KV[K,V]` struct bridges between the two.

**Comparison function variants**: Functions involving ordering have up to three forms — constrained to `cmp.Ordered`, a `Func` version accepting a comparator, and a `FuncKV` version.

**Lazy vs eager**: Transformation functions (Map, Filter, Chunk, Drop, etc.) return new iterators via closures over `yield func(T) bool`. Aggregation functions (Reduce, Min, Max, Count, etc.) consume the entire sequence eagerly.

**Testing**: All tests are `Example` functions — they serve as both documentation and regression tests. No traditional unit tests. Run a single example with `go test -run ExampleFunctionName`.

**Commit tags**: Commit messages use `#patch`, `#minor`, `#major`, or `#none` suffixes for automated semantic version bumping.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/freeformz/seq

go 1.23
go 1.25
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
go = "1.25.7"
Loading