title: basic haskell : Copying elements
body: <p>I'm trying to recursively call a function that copies any type a specified amount of times
  for example copy 3 'a' would give me ['a','a','a'] while copy 3 2 would give me [2,2,2]
  This is what I have so far but I'm not sure if my typeline is correct as I think my code should run fine. Can anyone see what's wrong?</p>
  
  <pre><code>copy :: Int-&gt;a-&gt;[a]
  copy x [] = []
  copy y a = a:(copy (y-1) a)
  </code></pre>
  
  <p>edit: updated to this:</p>
  
  <pre><code>copy :: Int-&gt;a-&gt;[a]
  copy 0 a = [] 
  copy y a = [a]++(copy (y-1) a)
  </code></pre>
  
  <p>However this gives me "aaa" instead of [a,a,a]</p>