projects
/
matthijs
/
master-project
/
support
/
tfvec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7533cdf
)
Split copy function in two, one that accepts a lenght param, and one that doesn't
author
Christiaan Baaij
<christiaan.baaij@gmail.com>
Mon, 29 Jun 2009 13:47:07 +0000
(15:47 +0200)
committer
Christiaan Baaij
<christiaan.baaij@gmail.com>
Mon, 29 Jun 2009 13:47:07 +0000
(15:47 +0200)
Data/Param/TFVec.hs
patch
|
blob
|
history
diff --git
a/Data/Param/TFVec.hs
b/Data/Param/TFVec.hs
index dbe46e97934e73a1c22c3496491ae9aa11fd40c8..50b2fda258b44de6c285aeacae5889aeeddd5ab9 100644
(file)
--- 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 =