Sequence
extension Sequence
extension Sequence where Element: Equatable
-
All of the values which are the least or greatest given the
areInIncreasingOrder
closure.Note
Consider returning (Element, count: Int)? instead ofArray
.Declaration
Swift
public func extrema <T> (property: (Element) -> T, areInIncreasingOrder: (T,T) -> Bool) -> [Element] where T: Comparable
-
Declaration
Swift
public func min<T>(property: (Element) -> T) -> [Element] where T : Comparable
Return Value
All of the values which are equivalent to the minimum value contained herein.
-
Declaration
Swift
public func max<T>(property: (Element) -> T) -> [Element] where T : Comparable
Return Value
All of the values which are equivalent to the maximum value contained herein.
-
Declaration
Swift
public var isHomogeneous: Bool { get }
Return Value
true
if there are one or fewer elements inself
, or if all elements inself
are logically equivalent. -
Declaration
Swift
public var isHeterogeneous: Bool { get }
Return Value
false
if there are one or fewer elements inself
, or if any elements inself
are not logically equivalent.