X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=clash%2FData%2FParam%2FVector.hs;h=6f5b722517b1b3c177f02125675855521eb36692;hp=32218be266f4d9f1e85cccfcf164414a31cc229e;hb=63b8956c3d9c50a619e7a9fa674b533f7ef5f3a7;hpb=bebe01ce76e62bea88aba87d5cceecfab7a0c6c4 diff --git a/clash/Data/Param/Vector.hs b/clash/Data/Param/Vector.hs index 32218be..6f5b722 100644 --- a/clash/Data/Param/Vector.hs +++ b/clash/Data/Param/Vector.hs @@ -109,16 +109,14 @@ fromVector (Vector xs) = xs null :: Vector D0 a -> Bool null _ = True -(!) :: ( PositiveT s - , NaturalT u - , (s :>: u) ~ True) => Vector s a -> Index u -> a +(!) :: PositiveT s => Vector s a -> Index s -> a (Vector xs) ! i = xs !! (fromInteger (toInteger i)) -- ========================== -- = Transforming functions = -- ========================== -replace :: (PositiveT s, NaturalT u, (s :>: u) ~ True) => - Vector s a -> Index u -> a -> Vector s a +replace :: PositiveT s => + Vector s a -> Index s -> a -> Vector s a replace (Vector xs) i y = Vector $ replace' xs (toInteger i) y where replace' [] _ _ = [] replace' (_:xs) 0 y = (y:xs)