-- | Safe indexing.
+--
-- Examples:
--
-- >>> let v1 = make3d (1,2,3)
| otherwise = Just $ v1 ! idx
+-- | Convert vector to a list.
+--
+-- Examples:
+--
+-- >>> let v1 = make2d (1,2)
+-- >>> toList v1
+-- [1,2]
+--
+toList :: (V.Vector v a) => Vn (v a) -> [a]
+toList (Vn v1) = V.toList v1
+
+
+-- | Convert a list to a vector.
+--
+-- Examples:
+--
+-- >>> fromList [1,2] :: Vn (Vec2D Int)
+-- (1,2)
+--
+fromList :: (V.Vector v a) => [a] -> Vn (v a)
+fromList xs = Vn $ V.fromList xs
+
-- * Two- and three-dimensional wrappers.
--
-- These two wrappers are instances of 'Vector', so they inherit all