Other Functions
The following functions are available globally.
-
Declaration
Swift
public func cartesianProduct <T,U> (_ a: T, _ b: U) -> [(T.Element, U.Element)] where T: Sequence, U: SequenceReturn Value
Cartesian product of two sequences.
-
let (lower,higher) = ordered(7,3) // => (3,7)
Note
If both values are equal, they are returned in the order in which they were given
Declaration
Swift
public func ordered<T>(_ a: T, _ b: T) -> (T, T) where T : ComparableReturn Value
2-tuple of two given values, in order.
-
Applies the given transform
fto the given valuesaandb.Declaration
Swift
public func map<T, U>(_ a: T, _ b: T, _ f: (T) -> U) -> (U, U) -
Applies the given transform
fto the given valuesaandb,c.Declaration
Swift
public func map<T, U>(_ a: T, _ b: T, _ c: T, _ f: (T) -> U) -> (U, U, U) -
Applies the given transform
fto each value of the given tuplevalues.Declaration
Swift
public func map<T, U>(_ values: (T, T), _ f: (T) -> U) -> (U, U) -
Applies the given transform
fto each value of the given tuplevalues.Declaration
Swift
public func map<T, U>(_ values: (T, T, T), _ f: (T) -> U) -> (U, U, U)
View on GitHub
Install in Dash
Other Functions Reference