However, this has nothing to do with generics.If you're willing to sacrifice performance, you could easily write
extension Array { func take(_ n: Int) -> [Element] { Array(self[0..<n]) } }
However, this has nothing to do with generics.If you're willing to sacrifice performance, you could easily write