Hi Felix - thanks for looking at this! There's an implementation of rotate in test/Prototypes/Algorithms.swift.gyb. You can take a look at that - there are a couple different approaches.
In any case, to add this to the standard library would require a Swift Evolution proposal. If you're interested in submitting one of those, you'll want to take a look at the one that was rejected for Swift 3 and the rationale there.