title: How to get a case of enum in one line?
body: <p>I have a <code>enum</code> with some <code>case</code>, and a array with instances of this <code>enum</code>, for example:</p>
  
  <pre><code>enum MyEnum {
      case foo(Int)
      case bar(Int)
      case baz(Int)
  }
  
  let myArray = [
      MyEnum.foo(1),
      MyEnum.bar(2),
      MyEnum.baz(3)
  ]
  </code></pre>
  
  <p>Then, I need to compare if determinate element of this array if <code>foo</code>, <code>baz</code> or <code>baz</code>, for example:</p>
  
  <pre><code>myArray.filter { $0 == .foo } // not work, and should need return [MyEnum.foo(1)]
  </code></pre>
  
  <p>I can use <code>switch</code>:</p>
  
  <pre><code>myArray.filter {
      switch $0 {
      case .foo(_):
          return true
      default:
          return false
      }
  } // work, and return [MyEnum.foo(1)]
  </code></pre>
  
  <p>But, I want a solution less verbose, and learning more about <code>enum</code>.</p>