title: Implementation of a map function
body: <p>I'm trying to implement a Scheme-like <code>map</code> function, i.e.</p>
  
  <pre><code>map([X1, X2, ..], Fun) -&gt;[Fun(X1), Fun(X2), ...] 
  </code></pre>
  
  <p>I wrote this code:</p>
  
  <pre><code>map([], Fun, []).
  map([H|T], Fun, [HO|TO]) :- call(Fun, H, HO), map(T,F,TO).
  </code></pre>
  
  <p>Now, looking at this run:</p>
  
  <pre><code>?- map([1,2,3], plus(1), X).
  X = [2, 3, 4] ;
  X = [2, 3, 4] ;
  X = [2, 3, 4] ;
  X = [2, 3, 4] ;
  ERROR: map/3: Arguments are not sufficiently instantiated
     Exception: (9) map([3], _G380, _G351) ?
  </code></pre>
  
  <ol>
  <li>How can I make it stop after the first solution provided?</li>
  <li>How can I trace it?If i use <code>trace</code> it stop the execution after the first solution.</li>
  </ol>