<commit_before>//
//  Queryable.swift
//
//  Created by <NAME> on 12/28/16.
//  Copyright © 2016 App-Order. All rights reserved.
//

import Foundation

// TODO: Document

public protocol Queryable: Sequence {
    
    func filter(_ predicate: NSPredicate) -> Self
    
    func count() -> Int
    
}

/*
 *  MARK: - Is Empty
 */

extension Queryable {
    
    public final var isEmpty: Bool {
        return count() == 0
    }
    
}

extension Queryable where Self: Enumerable {
    
    public final var isEmpty: Bool {
        return take(1).count() == 0
    }
    
}<commit_msg>Fixed ambiguity issue for 'isEmpty' on 'Queryable'<commit_after>//
//  Queryable.swift
//
//  Created by <NAME> on 12/28/16.
//  Copyright © 2016 App-Order. All rights reserved.
//

import Foundation

// TODO: Document

public protocol Queryable: Sequence {
    
    func filter(_ predicate: NSPredicate) -> Self
    
    func count() -> Int
    
}

/*
 *  MARK: - Is Empty
 */

extension Queryable {
    
    public final var isEmpty: Bool {
        return count() == 0
    }
    
}

extension Queryable where Self: Enumerable {
    
    public final var isEmpty: Bool {
        return take(1).count() == 0
    }
    
}

extension Collection where Self: Queryable {
    
    public final var isEmpty: Bool {
        return count() == 0
    }
    
}

extension Collection where Self: Queryable & Enumerable {
    
    public final var isEmpty: Bool {
        return take(1).count() == 0
    }
    
}
{'fraction_non_alphanumeric': 0.11201079622132254, 'fraction_numerical': 0.019568151147098516, 'mean_word_length': 2.051440329218107, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4301503', 'n_tokens_mistral': 499, 'n_tokens_neox': 455, 'n_words': 145}