You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.
Would it be possible to add a function, replaceVec, similar to "replace" from CLaSH.Sized.Vector which replaces a slice instead of a single element?
Perhaps something like:
replaceVec :: (KnownNat m) => SNat o -> Vec m a -> Vec (o + p + m) a -> Vec (o + p + m) a
replaceVec offset replacement vec = vecTruncated ++ replacement ++ vecTail
where
vecTruncated = take offset vec
vecTail = drop (offset `addSNat` lengthS replacement) vec
The text was updated successfully, but these errors were encountered:
@adamwalker Do you want a "static" version, like the example you posted (which is sorta similar to setSlice), or do you want a "dynamic" version, similar to the replace function you mentioned? Or do you want both?
Well, I think it should behave however you decide is most sensible :)
But, in my opinion it should behave similar to replace and give a runtime error.
What does replace do in actual hardware when the index is out of bounds?
Would it be possible to add a function, replaceVec, similar to "replace" from CLaSH.Sized.Vector which replaces a slice instead of a single element?
Perhaps something like:
The text was updated successfully, but these errors were encountered: