Skip to content

operator to get a shuffled static method ref #1370

@gavinking

Description

@gavinking

I would really like to be able to write this:

{ "hello", "goodbye" }.map(String!plus(" world"))

Or perhaps even:

{ "hello", "goodbye" }.map(String.plus!(" world"))

Here ! is basically just a shortcut for shuffle(), though it could be compiled to something more optimal.

Yesyes we can already write the above using Iterable.spread():

{ "hello", "goodbye" }.spread(String.plus)(" world")

but that really doesn't handle all usecases. What about this case, for example:

{ "hello", "goodbye" }.every(String!longerThan(10))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions