@@ -1035,6 +1035,7 @@ This type is special-cased by both the kernel and the compiler:
10351035 to 2^63 directly and larger numbers use an arbitrary precision "bignum"
10361036 library (usually [ GMP ] (https://gmplib.org/)).
10371037 -/
1038+ @[opaque_repr]
10381039inductive Nat where
10391040 /-- `Nat.zero`, normally written `0 : Nat`, is the smallest natural number.
10401041 This is one of the two constructors of `Nat`. -/
@@ -1780,6 +1781,7 @@ def UInt8.size : Nat := 256
17801781The type of unsigned 8-bit integers. This type has special support in the
17811782compiler to make it actually 8 bits rather than wrapping a `Nat`.
17821783-/
1784+ @[opaque_repr]
17831785structure UInt8 where
17841786 /-- Unpack a `UInt8` as a `Nat` less than `2^8`.
17851787 This function is overridden with a native implementation. -/
@@ -1819,6 +1821,7 @@ def UInt16.size : Nat := 65536
18191821The type of unsigned 16-bit integers. This type has special support in the
18201822compiler to make it actually 16 bits rather than wrapping a `Nat`.
18211823-/
1824+ @[opaque_repr]
18221825structure UInt16 where
18231826 /-- Unpack a `UInt16` as a `Nat` less than `2^16`.
18241827 This function is overridden with a native implementation. -/
@@ -1858,6 +1861,7 @@ def UInt32.size : Nat := 4294967296
18581861The type of unsigned 32-bit integers. This type has special support in the
18591862compiler to make it actually 32 bits rather than wrapping a `Nat`.
18601863-/
1864+ @[opaque_repr]
18611865structure UInt32 where
18621866 /-- Unpack a `UInt32` as a `Nat` less than `2^32`.
18631867 This function is overridden with a native implementation. -/
@@ -1934,6 +1938,7 @@ def UInt64.size : Nat := 18446744073709551616
19341938The type of unsigned 64-bit integers. This type has special support in the
19351939compiler to make it actually 64 bits rather than wrapping a `Nat`.
19361940-/
1941+ @[opaque_repr]
19371942structure UInt64 where
19381943 /-- Unpack a `UInt64` as a `Nat` less than `2^64`.
19391944 This function is overridden with a native implementation. -/
@@ -1985,6 +1990,7 @@ for the platform's architecture.
19851990For example, if running on a 32-bit machine, USize is equivalent to UInt32.
19861991Or on a 64-bit machine, UInt64.
19871992-/
1993+ @[opaque_repr]
19881994structure USize where
19891995 /-- Unpack a `USize` as a `Nat` less than `USize.size`.
19901996 This function is overridden with a native implementation. -/
@@ -2268,6 +2274,7 @@ def List.get {α : Type u} : (as : List α) → Fin as.length → α
22682274The compiler overrides the data representation of this type to a byte sequence,
22692275and both `String.utf8ByteSize` and `String.length` are cached and O(1).
22702276-/
2277+ @[opaque_repr]
22712278structure String where
22722279 /-- Pack a `List Char` into a `String`. This function is overridden by the
22732280 compiler and is O(n) in the length of the list. -/
@@ -2492,6 +2499,7 @@ as they are used "linearly" all updates will be performed destructively on the
24922499array, so it has comparable performance to mutable arrays in imperative
24932500programming languages.
24942501-/
2502+ @[opaque_repr]
24952503structure Array (α : Type u) where
24962504 /-- Convert a `List α` into an `Array α`. This function is overridden
24972505 to `List.toArray` and is O(n) in the length of the list. -/
0 commit comments