Currently, Data.Vector.Mutable.Linear and Data.Vector.Mutable.Array have separate, but similar implementations. We can remove some duplication via implementing the Vector in terms of Array.
- Arrays should be ordinary arrays with
read and write functions working with indexes and with an explicit resize functionality.
- Vectors should growable arrays supporting
push and pop operations efficiently by maintaining some spare capacity.
Currently,
Data.Vector.Mutable.LinearandData.Vector.Mutable.Arrayhave separate, but similar implementations. We can remove some duplication via implementing theVectorin terms ofArray.readandwritefunctions working with indexes and with an explicitresizefunctionality.pushandpopoperations efficiently by maintaining some spare capacity.