Skip to content

Instantly share code, notes, and snippets.

@lancep
Last active November 6, 2018 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lancep/71fb3b4d703d4d2d03b30b4bf1df7b88 to your computer and use it in GitHub Desktop.
Save lancep/71fb3b4d703d4d2d03b30b4bf1df7b88 to your computer and use it in GitHub Desktop.
var headAndTail: (head: Element, tail: SubSequence)? {
var iter = makeIterator()
guard let head = iter.next() else { return nil }
let tail = dropFirst(0)
return (head, tail)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment