aboutsummaryrefslogtreecommitdiffstats
path: root/internal/tag
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-03-02 17:38:55 -0500
committerSam Anthony <sam@samanthony.xyz>2026-03-02 17:38:55 -0500
commit8858a54b5ddb3a2d8a42ecb1a837c02800bc934f (patch)
tree2428c445936eb8865c0b7c8f52560e97a44082f3 /internal/tag
parentc6cd37a6b80d4e5ad1dbf8c8968b818811b8aa54 (diff)
downloadgui-8858a54b5ddb3a2d8a42ecb1a837c02800bc934f.zip
create lay/strain package
The lay/strain package uses the Cassowary algorithm to solve systems of layout constraints.
Diffstat (limited to 'internal/tag')
-rw-r--r--internal/tag/tag.go12
1 files changed, 12 insertions, 0 deletions
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)}
+ }
+}