Skip to content

Instantly share code, notes, and snippets.

View mateuszbaran's full-sized avatar

Mateusz Baran mateuszbaran

View GitHub Profile
"""
ziptuples(a, b)
Zips tuples `a` and `b` in a fast, type-stable way. If they have different
lengths, the result is trimmed to the length of the shorter tuple.
"""
@generated function ziptuples(a::NTuple{N,Any}, b::NTuple{M,Any}) where {N,M}
ex = Expr(:tuple)
for i = 1:min(N, M)