<commit_before>// Copyright © 2020 Flinesoft. All rights reserved.

/// Simple protocol to make modifying objects with multiple properties more pleasant (functional, chainable, point-free).
public protocol Withable { /* no requirements */ }

extension Withable {
    /// Create a copy (if a struct) or use same object (if class), improving chainability e.g. after init method.
    @inlinable
    public func with(_ config: (inout Self) -> Void) -> Self {
        var copy = self
        config(&copy)
        return copy
    }
}<commit_msg>Mark removed method as unavailable for easier migration<commit_after>// Copyright © 2020 Flinesoft. All rights reserved.

/// Simple protocol to make modifying objects with multiple properties more pleasant (functional, chainable, point-free).
public protocol Withable { /* no requirements */ }

extension Withable {
    @available(*, unavailable, message: "Add `().with` after the type name, e.g. `Foo().with { $0.bar = 5 }` instead of `Foo { $0.bar = 5 }`.")
    @inlinable
    public init(with config: (inout Self) -> Void) { // swiftlint:disable:this missing_docs
        fatalError("Function no longer available. Xcode should actually show an unavailable error with message and not compile.")
    }

    /// Create a copy (if a struct) or use same object (if class), improving chainability e.g. after init method.
    @inlinable
    public func with(_ config: (inout Self) -> Void) -> Self {
        var copy = self
        config(&copy)
        return copy
    }
}
{'fraction_non_alphanumeric': 0.10529801324503311, 'fraction_numerical': 0.007947019867549669, 'mean_word_length': 3.1059782608695654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4812706', 'n_tokens_mistral': 417, 'n_tokens_neox': 392, 'n_words': 174}