The GM.MVector v a
constaint is ambigous in v
. In other words, from the type information you've given GHC, it still can't figure out what specific instance of GM.MVector
you want it to use. For a mutable vector of Int
use Data.Vector.Unboxed.Mutable
.
import qualified Data.Vector.Unboxed.Mutable as M
main = do
v <- M.new 10
M.write v 0 (3 :: Int)
x <- M.read v 0
print x