Skip to content

Instantly share code, notes, and snippets.

@lancep
Last active November 6, 2018 21:55
Show Gist options
  • Select an option

  • Save lancep/71fb3b4d703d4d2d03b30b4bf1df7b88 to your computer and use it in GitHub Desktop.

Select an option

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