X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fsupport%2Ftfvec.git;a=blobdiff_plain;f=Data%2FParam%2FTFVec.hs;h=50b2fda258b44de6c285aeacae5889aeeddd5ab9;hp=dbe46e97934e73a1c22c3496491ae9aa11fd40c8;hb=ba75d3efd05940488c5816ed20413d5f5f113e58;hpb=7533cdf220a6bafd6ade70b6cfba9faddb65affa diff --git a/Data/Param/TFVec.hs b/Data/Param/TFVec.hs index dbe46e9..50b2fda 100644 --- a/Data/Param/TFVec.hs +++ b/Data/Param/TFVec.hs @@ -53,6 +53,7 @@ module Data.Param.TFVec , iterate , generate , copy + , copyn ) where @@ -234,8 +235,11 @@ iterate s f x = let s' = fromIntegerT s in TFVec (P.take s' $ P.iterate f x) generate :: NaturalT s => s -> (a -> a) -> a -> TFVec s a generate s f x = let s' = fromIntegerT s in TFVec (P.take s' $ P.tail $ P.iterate f x) -copy :: NaturalT s => s -> a -> TFVec s a -copy s x = iterate s id x +copy :: NaturalT s => a -> TFVec s a +copy x = copyn (undefined :: s) x + +copyn :: NaturalT s => s -> a -> TFVec s a +copyn s x = iterate s id x -- ============= -- = Instances =