title: How is map implemented internally?
body: <p>Ok so i want to implement my custom map that receives a replication factor and a target list.</p>
  
  <p>Inputs:  <code>Int -&gt; [Int]</code><br>
  Output: <code>[[Int]]</code><br>
  E.g.:  <code>2 [1,2]    -----&gt; [[1,1],[2,2]]</code><br></p>
  
  <p><code>f [1,2,3]</code> -> map -> <code>[f(1),f(2),f(3)]</code></p>
  
  <p>What is supposed to happen with f(1) when map goes to the next element of the list?How should  i replace 1 with f(1) ? </p>
  
  <p>P.S: This was my initial solution but it does replicate the initial list,not every element.</p>
  
  <pre><code>replicate::Int-&gt;[Int]-&gt;[[Int]]
  replicate 1 x=x
  replicate factor (x:xs)= go factor [] (x:xs) where
                           go factor ls (x:xs) =go factor (repl factor x):ls xs 
                           repl 1 nr=nr
                           repl times nr=nr:repl (times-1) nr
  </code></pre>