title: Swift array reduction: cannot use mutating member on immutable value
body: <p>I have the following code that attempts to consolidate redundant elements of an array:</p>
  
  <pre><code>var items : [String] = ["hello", "world", "!", "hello"]
  
  var mutableSet = Set&lt;String&gt;()
  
  items.reduce(mutableSet, combine: { (set: Set&lt;String&gt;, element: String) in
      return set.insert(element)
  })
  </code></pre>
  
  <p><code>set.insert(element)</code> gives me the error <code>Cannot use mutating member on immutable value: 'set' is a 'let' constant</code>. What's wrong and how can I fix it?</p>