[swift-evolution] Proposal: Implement == and < for tuples where possible, up to some high arity

Brent Royal-Gordon brent at architechies.com
Mon Dec 7 18:11:02 CST 2015

> you can implement its < operator as simply "return (a1,b1,c1,d1,e1) < (a2,b2,c2,d2,e2)”.

	return zip([a1,b1,c1,d1,e1], [a2,b2,c2,d2,e2]).lazy.filter(==).first.flatMap(<) ?? false

Okay, so that wasn’t quite as easy as I thought when I started writing the email.

Brent Royal-Gordon

More information about the swift-evolution mailing list