vector icon indicating copy to clipboard operation
vector copied to clipboard

MVector data instances are exposed from Unboxed and Unboxed.Mutable

Open meooow25 opened this issue 9 months ago • 2 comments

https://github.com/haskell/vector/blob/6b8bbc3a75b40451d8d225e30c576dfe89121c49/vector/src/Data/Vector/Unboxed.hs#L61-L63

https://github.com/haskell/vector/blob/6b8bbc3a75b40451d8d225e30c576dfe89121c49/vector/src/Data/Vector/Unboxed/Mutable.hs#L17-L19

I was confused as to why Vector data instances are not exposed but MVector instances are.

Then I found https://github.com/haskell/vector/issues/49#issuecomment-62709758 which explains why exposing them is unsafe, which is fair. But then there is no reason to expose the MVector instances. This wasn't answered in #49.

I would expect this to consistent between Vector and MVector. Or perhaps this issue is known but the MVector instances are not hidden to avoid breakage?

meooow25 avatar May 03 '24 13:05 meooow25

Yes mutable vector were exposed early in the development for some reason. And yes hiding them is a breaking change

Shimuuar avatar May 03 '24 19:05 Shimuuar

Thanks, that answers the question! Please close this if there is nothing to be done about it.

meooow25 avatar May 03 '24 20:05 meooow25