This obviously just illustrates a point, but callbacks and decorators are not uncommon. And iterators are exactly like that:
type (
Seq[V any] func(yield func(V) bool)
Seq2[K, V any] func(yield func(K, V) bool)
)
Which is very readable.
This obviously just illustrates a point, but callbacks and decorators are not uncommon. And iterators are exactly like that:
type (
Seq[V any] func(yield func(V) bool)
Seq2[K, V any] func(yield func(K, V) bool)
)
Which is very readable.