Open leaxoy opened 3 months ago
These are in the xiter thread as Map21
and Map12
https://github.com/golang/go/issues/61898#issuecomment-1683969720
These are in the xiter thread as
Map21
andMap12
#61898 (comment)
My personal thought is that this conversion is crucial for developers who write fundamental libraries, and placing it in xiter
requires the basic library to introduce an additional package. In many cases, it is expected that only import the std
.
Here's my two cents: Zip
(Seq2 to Seq) and Unzip
(Seq to Seq2). But Map21
and Map12
sound great to me too.
Oh, shoot, never mind, Zip
is already taken by proposal https://github.com/golang/go/issues/61898.
Proposal Details
Recently we introduce iter package with two Seq types:
Seq
andSeq2
.Writing operations on both types are annoying and repetitive.
So I propose add function to convert
Seq
toSeq2
andSeq2
toSeq
Possible function signatures: