Is there a way to write an `if case` statement as an expression? : <p>Consider this code:</p>

<pre><code>enum Type {
    case Foo(Int)
    case Bar(Int)

    var isBar: Bool {
        if case .Bar = self {
            return true
        } else {
            return false
        }
    }
}
</code></pre>

<p>That's gross. I would like to write something like this instead:</p>

<pre><code>enum Type {
    case Foo(Int)
    case Bar(Int)

    var isBar: Bool {
        return case .Bar = self
    }
}
</code></pre>

<p>But such a construct does not seem to exist in Swift, or I cannot find it.</p>

<p>Since there's data associated with each case, I don't think it's possible to implement the <code>~=</code> operator (or any other helper) in a way that's equivalent to the above expression. And in any case, <code>if case</code> statements exist for free for all enums, and don't need to be manually implemented.</p>

<p>Thus my question: is there any more concise/declarative/clean/idiomatic way to implement <code>isBar</code> than what I have above? Or, more directly, is there any way to express <code>if case</code> <em>statements</em> as Swift <em>expressions</em>?</p>
