toM :: forall a m n . (AdditiveUnital a, KnownNat m, KnownNat n) => [a] -> M m n a
toM l = M $ V.fromList $ P.take (m*n) $ l P.++ P.repeat zero
  where
    m = P.fromInteger $ natVal (Proxy :: Proxy m)
    n = P.fromInteger $ natVal (Proxy :: Proxy n)
toM :: forall a m n . (AdditiveUnital a, KnownNat m, KnownNat n) => [a] -> M m n a
toM l = M $ V.fromList $ P.take (m*n) $ l P.++ P.repeat zero
  where
    m = P.fromInteger $ natVal (Proxy :: Proxy m)
    n = P.fromInteger $ natVal (Proxy :: Proxy n)
toM l = M $ V.fromList $ P.take (m*n) $ l P.++ P.repeat zero
  where
    m = P.fromInteger $ natVal (Proxy :: Proxy m)
    n = P.fromInteger $ natVal (Proxy :: Proxy n)