swiftlang / swiftlang/swift-experimental-string-processing

Adopt lightweight generics for generic functions

Open
#325 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
308
Forks
52
Avg merge
12h 45m
Merged PRs (30d)
2

Description

Functions that take a generic argument should adopt light weight generics and refer to the type directly as the argument type.

For example,

public func contains<C: Collection>(_ other: C) -> Bool

would be

public func contains(_ other: some Collection<Element>) -> Bool

Adoption of standard library types is blocked by https://github.com/apple/swift/pull/41843

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inventorying the generic functions in the project and compare their signatures with the lightweight generics form shown in the issue. Check the status of apple/swift#41843 first, since standard library adoption is blocked there; done means the applicable functions consistently use the direct argument-type syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.