<commit_before>//
//  DebugSinkOf.swift
//  ReactiveCocoa
//
//  Created by <NAME> on 5/19/15.
//  Copyright (c) 2015 GitHub. All rights reserved.
//

import Foundation

public struct DebugSinkOf<T> : SinkType {
	typealias Element = T
	
	let putElement: (T) -> ()
	
	/// Construct an instance whose `put(x)` calls `putElement(x)`
	public init(_ putElement: (T) -> ()) {
		self.putElement = putElement
	}
	
	/// Construct an instance whose `put(x)` calls `base.put(x)`
	public init<S : SinkType where S.Element == T>(var _ base: S) {
		self.putElement = {base.put($0)}
	}
	
	/// Write `x` to this sink.
	public func put(x: T) {
		putElement(x)
	}
}<commit_msg>Document DebugSinkOf and make its conventions match<commit_after>//
//  DebugSinkOf.swift
//  ReactiveCocoa
//
//  Created by <NAME> on 5/19/15.
//  Copyright (c) 2015 GitHub. All rights reserved.
//

import Foundation

/// A replacement for SinkOf that allows stepping in through the debugger.
public struct DebugSinkOf<T>: SinkType {
	typealias Element = T
	
	private let putElement: T -> ()
	
	/// Construct an instance whose `put(x)` calls `putElement(x)`
	public init(_ putElement: T -> ()) {
		self.putElement = putElement
	}
	
	/// Construct an instance whose `put(x)` calls `base.put(x)`
	public init<S: SinkType where S.Element == T>(var _ base: S) {
		putElement = { base.put($0) }
	}

	/// Write `x` to this sink.
	public func put(x: T) {
		putElement(x)
	}
}
{'fraction_non_alphanumeric': 0.1504548635409377, 'fraction_numerical': 0.013995801259622114, 'mean_word_length': 3.132947976878613, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '2216425', 'n_tokens_mistral': 541, 'n_tokens_neox': 504, 'n_words': 152}