haskell / vector

An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework .
Other
366 stars 139 forks source link

MVector data instances are exposed from Unboxed and Unboxed.Mutable #492

Open meooow25 opened 7 months ago

meooow25 commented 7 months ago

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?

Shimuuar commented 7 months ago

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

meooow25 commented 7 months ago

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