title: swift: Elegant Way to Map Optional to Array
body: <p>I am looking for an elegant way to map an <code>Optional</code> to an <code>Array</code>. What I mean by that is the following:</p>
  
  <ul>
  <li>If the <code>Optional</code> is <code>.none</code>, return an empty <code>Array&lt;Wrapped&gt;</code></li>
  <li>If the <code>Optional</code> is <code>.some</code>, return a single element <code>Array&lt;Wrapped&gt;</code></li>
  </ul>
  
  <p>Now this can be done like this</p>
  
  <pre><code>let seq = value.map { [$0] } ?? []
  </code></pre>
  
  <p>Unfortunately this gets quite ugly and illegible when you want to use it inline.</p>
  
  <p>Is there a better method to accomplish this, without writing a <code>extension</code>?</p>