Skip to content

Instantly share code, notes, and snippets.

View frankxzx's full-sized avatar
🏠
Working from home

Xu frankxzx

🏠
Working from home
View GitHub Profile
{"sig":"8d4ce5ba1209b8972a249ee44964d52e78e51fa91ca2e79ef84233840ef42f458f5e6e10250ac30ae23591c791f50a926c419b61c403aa0201d8ba63948d48bf0","msghash":"822ebd8f7acd9856953d61f2de33a0ec9547f2ed4f546b3a7af487fb0cd3d19e"}
typealias Check<U> = (U, U) -> Bool
func compare<T>(ls: T, rs: T, check: Check<T>) -> Bool {
return check(ls, rs)
}
let a = compare(ls: 2, rs: 3) { $0 > $1 }