# Why no Data.init(immutableBytesNoCopy:...)?

**URL:** <https://forums.swift.org/t/why-no-data-init-immutablebytesnocopy/55224>\
**Category:** Using Swift\
**Created:** [February 9, 2022, 6:31pm UTC](https://forums.swift.org/t/why-no-data-init-immutablebytesnocopy/55224 "2022-02-09T18:31:56Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Karl](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@Karl](https://forums.swift.org/u/Karl)\
**Post date:** [February 11, 2022, 1:14pm UTC](https://forums.swift.org/t/why-no-data-init-immutablebytesnocopy/55224/18 "2022-02-11T13:14:02Z")

</div>

> [@tera](#):
>
> because that's what I actually meant. i.e. the main currency type, expressible with [Int], etc, in that pseudo code is a protocol, not a concrete type. This might or might not change your answer.
> 
> Perhaps this is not the swift way.. For example StringProtocol is even discouraged for new conformances. And I can't pass some custom collection ("RandomAccessCollection of Int elements") to a function that has [Int] argument (this would be cool IMHO).

`[Int]` is just sugar for `Array<Int>`, and changing that would be massively source-breaking.

I agree that generic functions are much more awkward to write, which is why the current efforts to improve generics syntax are so important. For example:

- [SE-0341: Opaque Parameter Declarations](https://forums.swift.org/t/se0341-opaque-parameter-declarations/55082/1)

- [[Pitch 2] Light-weight same-type requirement syntax](https://forums.swift.org/t/pitch-2-light-weight-same-type-requirement-syntax/55081/1)

But the syntax is only part of the problem; the other part is gaps in capabilities. It seems like those are [also being addressed](https://github.com/apple/swift/pull/41328), so the overall generics model is becoming much more usable and complete.

---

_[View the full topic](https://forums.swift.org/t/why-no-data-init-immutablebytesnocopy/55224)._
