title: case class - combine pattern match
body: <p>I have a method defined as below and wanted to combine pattern match. The or operator give me compiler error (||).</p>
  
  <pre><code>def isPaired(input: String): Boolean = {
  
      def go(x: List[Char], level: Int = 0): Boolean = {
        x match {
          case Nil =&gt; true
          case '(' :: xs1 if level &lt; 0 =&gt; false
          case '[' :: xs1 if level &lt; 0 =&gt; false
          case '{' :: xs1 if level &lt; 0 =&gt; false
          case ')' :: xs1 if level == 0 =&gt; false
          case ']' :: xs1 if level == 0 =&gt; false
          case '}' :: xs1 if level == 0 =&gt; false
          case '(' :: xs1 =&gt; go(xs1, level + 1)
          case '[' :: xs1 =&gt; go(xs1, level + 1)
          case '{' :: xs1 =&gt; go(xs1, level + 1)
          case ')' :: xs1 =&gt; go(xs1, level - 1)
          case ']' :: xs1 =&gt; go(xs1, level - 1)
          case '}' :: xs1 =&gt; go(xs1, level - 1)
          case _ :: xs1 =&gt; go(xs1, level + 1)
        }
  
      }
      go(input.toList)
    }
  </code></pre>
  
  <p>The below gives compiler error:</p>
  
  <pre><code>case '(' :: xs1 || '[' :: xs1 || '{' :: xs1  if level &lt; 0 =&gt; false
  case ('(' :: xs1) || ('[' :: xs1) || ('{' :: xs1)  if level &lt; 0 =&gt; false
  </code></pre>
  
  <p>How to apply or condition?</p>