title: How to check if element is not in a list, if it isn't, insert it
body: <p>I want, given a list formed by A-B elements ([a-b,b-c,c-d]), check if some given element it's already in a list (which I will return), and if it's not, add any "A" or "B" element that is not in the output list yet.</p>
  
  <p>I haven't really found any "easy" enough answer for me to understand yet (like, I found one with mappings and stuff I've never used nor seen).</p>
  
  <p>So the output list would need to only have [a,b,c,d]</p>
  
  <p>edit: what I'm trying to do is, I get called like this:</p>
  
  <pre><code>enumerate([a-b,b-c,c-d], EnumNodes, EnumArcs)
  </code></pre>
  
  <p>And I have to return two lists. First one gives the nodes (with this specific form:</p>
  
  <p><code>[enum(1,a),enum(2,b),enum(3,c),enum(4,d)]</code>, </p>
  
  <p>and second one gives the arcs (the conections) between said nodes.</p>
  
  <p>So I am at the part where I "know" how to count and return items in a list, but I do not know the following:</p>
  
  <p>-How to insert ONLY unique elements in a list</p>
  
  <p>-How to first check if "A" is in the list, if not insert it, and then check if "B" is in the list, if not, insert it (reason for me not knowing this, I can't come with a way of invoking the rule, once it's done, twice, once for each element, each step of recursion, without making a mistake</p>