File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ instance (KnownNat n, Prim a) => Vectoring (Vec n a) a where
110110 let n :: Int
111111 n = fromIntegral $ natVal $ Proxy @ n
112112 mba <- newByteArray (n * sizeOf (undefined :: a ))
113- let new_vs = zipWith (\ i' v' -> if i' == i then v else v') [0 .. n] (listOfVec vec)
114- zipWithM_ (writeByteArray mba) [0 .. n] new_vs
113+ let new_vs = zipWith (\ i' v' -> if i' == i then v else v') [0 .. n- 1 ] (listOfVec vec)
114+ zipWithM_ (writeByteArray mba) [0 .. n- 1 ] new_vs
115115 ByteArray nba# <- unsafeFreezeByteArray mba
116116 return $! Vec nba#
117117 vecEmpty = mkVec
@@ -139,7 +139,7 @@ vecOfList :: forall n a. (KnownNat n, Prim a) => [a] -> Vec n a
139139vecOfList vs = runST $ do
140140 let n :: Int = fromIntegral $ natVal $ Proxy @ n
141141 mba <- newByteArray (n * sizeOf (undefined :: a ))
142- zipWithM_ (writeByteArray mba) [0 .. n] vs
142+ zipWithM_ (writeByteArray mba) [0 .. n- 1 ] vs
143143 ByteArray ba# <- unsafeFreezeByteArray mba
144144 return $! Vec ba#
145145
You can’t perform that action at this time.
0 commit comments