title: Prolog - get the first list from a list of lists
body: <p>I've got a list consisting of smaller lists inside of it, each list consisting of 2 items:  </p>
  
  <pre><code>[[a,1],[b,2],[c,3]]  
  </code></pre>
  
  <p>I'm using a function called take(1,L,R) to take the first item from list L and return the item R. The code for the take function is here:  </p>
  
  <pre><code>take(0,X,X).
  take(N,[H|T],[H|R]):- 
      N&gt;0, M is N-1,
      take(M,T,R).  
  </code></pre>
  
  <p>At the moment a run may look like this:  </p>
  
  <pre><code>1 ?- take(1,[[a],[b],[c]],Taken).
  Taken = [[a], [b], [c]]
  </code></pre>
  
  <p>Which is the same as the input! This is the same for a "regular" 1-level-depth list:  </p>
  
  <pre><code>2 ?- take(1,[a,b,c],Taken).
  Taken = [a, b, c]
  </code></pre>
  
  <p><strong>Question:</strong><br>
  The question for you is how can I make the result look like: </p>
  
  <pre><code>1 ?- take(1,[[a],[b],[c]],Taken).
  Taken = [a]
  </code></pre>
  
  <p>I want to return the first N items of the list I send it.</p>