Skip to content

Rename sameArray# to unsafeSameArray#?

MR !6075 (closed) added functions to compare immutable arrays: sameArray#, sameByteArray#, sameArrayArray#, sameSmallArray#.

This has been requested in #9192 (closed). However, there was another ticket where a similar request was made, #13908 (closed). Quoting Simon's comment from there:

I'm really not sure about this. Mutable arrays have identity so it makes sense to ask if they are "the same". Immutable arrays do not. Are the two lists [2,3] and [2,3] "the same"? Would it make a difference if you let-bound it let x = [2,3] in sameList x x?

I think this is a convincing argument. I have not seen it mentioned in !6075 (closed), so I'm opening this ticket for discussion.

Proposal: rename sameArray# to unsafeSameArray# (and others), keeping the old name during the deprecation period.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information