swift - Elegant way to get the first n elements of a SequenceType -


is there elegant way (think one-liner) first n elements of sequencetype in swift?

i of course write for-loop terminates after n elements that's little bulky.

note solution should able deal infinite sequences.

isn't mysequence.prefix(numberofelements) does?


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -