title: Insert specific element y after every n elements in a list
body: <p>I'm teaching myself Haskell and I've run across the question in my book that ask me to define a function insert that takes a positive integer <code>n</code>, element <code>y</code>, and a list <code>xs</code> that inserts the specified element <code>y</code> after every <code>n</code> elements in the list.</p>
  
  <p>I believe pattern matching would probably be a good way to go but I've yet to really grasp what it means</p>
  
  <pre><code>insert :: Int -&gt; Char -&gt; [a] -&gt; [a]
  insert 0 y xs = xs
  insert n y [] = []
  insert n y (x:xs)
  </code></pre>
  
  <p>An example of how the function should work:</p>
  
  <pre><code>insert 2 'X' "abcdefghijk" = "abXcdXefXghXijXk"
  </code></pre>
  
  <p>I've taken care of the base cases at this point but I don't know how to proceed from here.</p>
  
  <p>Any ideas? Thanks</p>