From 8858a54b5ddb3a2d8a42ecb1a837c02800bc934f Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Mon, 2 Mar 2026 17:38:55 -0500 Subject: create lay/strain package The lay/strain package uses the Cassowary algorithm to solve systems of layout constraints. --- internal/tag/tag.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 internal/tag/tag.go (limited to 'internal/tag') diff --git a/internal/tag/tag.go b/internal/tag/tag.go new file mode 100644 index 0000000..197d2d6 --- /dev/null +++ b/internal/tag/tag.go @@ -0,0 +1,12 @@ +package tag + +type Tagged[V, T any] struct { + Val V + Tag T +} + +func Tag[V, T any](out chan<- Tagged[V, T], in <-chan V, f func(V) T) { + for val := range in { + out <- Tagged[V, T]{val, f(val)} + } +} -- cgit v1.2.3