Join Nostr
2024-11-20 17:32:53 UTC

Rob Napier on Nostr: There are some Swift features that are just a delight, and `some` in parameter types ...

There are some Swift features that are just a delight, and `some` in parameter types is one of them.

I was just working on a bunch of code where everything expects arrays. Totally reasonable. But I wanted to introduce `chunks(ofCount:)` to replace our home-grown `chunks(of:)`, and that makes things lazy and changes the types.

A few mechanical conversions of `[?]` to `some Sequence<?>`, and boom, more flexible without adding a ton of syntax noise.