Predicate Composition
public func == <Root, Value>(block: @escaping (Root) -> Value, value: Value) -> (Root) -> Bool where Value : Equatable
public func != <Root, Value>(block: @escaping (Root) -> Value, value: Value) -> (Root) -> Bool where Value : Equatable
users.filter(\.name == "Milos")
users.filter(\.name != "Ste")
public func < <Root, Value>(block: @escaping (Root) -> Value, value: Value) -> (Root) -> Bool where Value : Comparable
public func > <Root, Value>(block: @escaping (Root) -> Value, value: Value) -> (Root) -> Bool where Value : Comparable
public func <= <Root, Value>(block: @escaping (Root) -> Value, value: Value) -> (Root) -> Bool where Value : Comparable
public func >= <Root, Value>(block: @escaping (Root) -> Value, value: Value) -> (Root) -> Bool where Value : Comparable
users.filter(\.age > 25)
users.filter(\.age <= 55)
public func << <Root, S>(block: @escaping (Root) -> S.Element, value: S) -> (Root) -> Bool where S : Sequence, S.Element : Equatable
public func ~= <Root>(block: @escaping (Root) -> String, regex: Regex) -> (Root) -> Bool
public func == <Root, Value>(block: @escaping (Root) -> Value, value: (Value, Value)) -> (Root) -> Bool where Value : FloatingPoint
public func ± <Value>(number: Value, accuracy: Value) -> (Value, Value) where Value : FloatingPoint
users.filter(\.age << 30...35) // Age is within the range 30-35
users.filter(\.age << [ 30, 32, 34 ]) // Age is one of 30, 32 or 34
users.filter(\.weight == 85 ± 4 //Weight is equal to 85, plus or minus 4, useful for comparing floating points where accuracy is not important
public prefix func ! <Root>(block: @escaping (Root) -> Bool) -> (Root) -> Bool
public func && <Root>(lhs: @autoclosure @escaping () -> Bool, rhs: @escaping (Root) -> Bool) -> (Root) -> Bool
public func || <Root>(lhs: @autoclosure @escaping () -> Bool, rhs: @escaping (Root) -> Bool) -> (Root) -> Bool
public func && <Root>(lhs: @escaping (Root) -> Bool, rhs: @autoclosure @escaping () -> Bool) -> (Root) -> Bool
public func || <Root>(lhs: @escaping (Root) -> Bool, rhs: @autoclosure @escaping () -> Bool) -> (Root) -> Bool
public func && <Root>(lhs: @escaping (Root) -> Bool, rhs: @escaping (Root) -> Bool) -> (Root) -> Bool
public func || <Root>(lhs: @escaping (Root) -> Bool, rhs: @escaping (Root) -> Bool) -> (Root) -> Bool
users.filter(\.isClearToFly && \.name == "Noah")
users.filter(\.age > 30 && \.name != "Noah")
package.append(.package(url: "https://github.com/ollieatkinson/Predicate.swift", from: "1.0.0"))