Skip to content

SE-0351 was accepted with mapOutput, but it's not implemented #668

Open
@tevelee

Description

@tevelee

The proposal for SE-0351 defines a way to map the output of a regex component to reorder captures, flatten nested optionals, or create instances of a custom type. See https://github.com/apple/swift-evolution/blob/main/proposals/0351-regex-builder.md#mapping-output
The proposal was accepted and its status is declared as Implemented (Swift 5.7), but this feature was left out from the compiler.

This is a crucial feature, and I miss it a lot whenever I deal with regexes in Swift. It's not possible to implement it as an extension by external users of the API, because it should have been a builtin component in the DSL tree.

I only found traces of it in the codebase, the PR #455 that implemented it was closed and the follow-up #466 is still in draft.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions