<commit_before>import ReactiveCocoa
import ReactiveBind

extension SignalProducerType {
    public func mapReplace<V>(@autoclosure(escaping) closure: () -> V) -> SignalProducer<V, Error> {
        return map { _ in closure() }
    }
    
    public func mapTrue() -> SignalProducer<Bool, Error> {
        return mapReplace(true)
    }
    
    public func mapFalse() -> SignalProducer<Bool, Error> {
        return mapReplace(false)
    }
    
    public func mapEmpty() -> SignalProducer<Void, Error> {
        return map { _ in SignalProducer<Void, Error>.empty }
    }
    
    public func filter(@autoclosure(escaping) closure: () -> Bool) -> SignalProducer<Value, Error> {
        return filter { _ in closure() }
    }
}

extension SignalProducerType where Value == Bool {
    public func not() -> SignalProducer<Value, Error> {
        return map { !$0 }
    }
}

extension SignalProducerType where Value == (Bool, Bool) {
    public func and() -> SignalProducer<Bool, Error> {
        return map { $0 && $1 }
    }
    public func or() -> SignalProducer<Bool, Error> {
        return map { $0 || $1 }
    }
}

extension SignalProducerType where Value == (Bool, Bool, Bool) {
    public func and() -> SignalProducer<Bool, Error> {
        return map { $0 && $1 && $2 }
    }
    public func or() -> SignalProducer<Bool, Error> {
        return map { $0 || $1 || $2 }
    }
}

extension SignalProducerType where Value == (Bool, Bool, Bool, Bool) {
    public func and() -> SignalProducer<Bool, Error> {
        return map { $0 && $1 && $2 && $3 }
    }<commit_msg>Fixed reactive extension for filter to allow filtering of single equatable values<commit_after>import ReactiveCocoa
import ReactiveBind

extension SignalProducerType {
    public func mapReplace<V>(@autoclosure(escaping) closure: () -> V) -> SignalProducer<V, Error> {
        return map { _ in closure() }
    }
    
    public func mapTrue() -> SignalProducer<Bool, Error> {
        return mapReplace(true)
    }
    
    public func mapFalse() -> SignalProducer<Bool, Error> {
        return mapReplace(false)
    }
    
    public func mapEmpty() -> SignalProducer<Void, Error> {
        return map { _ in SignalProducer<Void, Error>.empty }
    }
}

extension SignalProducerType where Value: Equatable {
    public func filter(value: Value) -> SignalProducer<Value, Error> {
        return filter { $0 == value }
    }
}

extension SignalProducerType where Value == Bool {
    public func not() -> SignalProducer<Value, Error> {
        return map { !$0 }
    }
}

extension SignalProducerType where Value == (Bool, Bool) {
    public func and() -> SignalProducer<Bool, Error> {
        return map { $0 && $1 }
    }
    public func or() -> SignalProducer<Bool, Error> {
        return map { $0 || $1 }
    }
}

extension SignalProducerType where Value == (Bool, Bool, Bool) {
    public func and() -> SignalProducer<Bool, Error> {
        return map { $0 && $1 && $2 }
    }
    public func or() -> SignalProducer<Bool, Error> {
        return map { $0 || $1 || $2 }
    }
}

extension SignalProducerType where Value == (Bool, Bool, Bool, Bool) {
    public func and() -> SignalProducer<Bool, Error> {
        return map { $0 && $1 && $2 && $3 }
    }
{'fraction_non_alphanumeric': 0.13108149984505732, 'fraction_numerical': 0.009606445615122404, 'mean_word_length': 2.714614499424626, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 54, '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': '5262556', 'n_tokens_mistral': 1035, 'n_tokens_neox': 979, 'n_words': 285}