title: Pattern matching for custom data constructor similar to lists
body: <p>I have a data constructor defined like this:</p>
  <pre><code>data Stack a = Empty | NonEmpty a (Stack a)
           deriving (Show, Read, Eq)
  </code></pre>
  <p>Then I have a function which uses it with pattern matching:</p>
  <pre><code>func :: Stack a -&gt; a
  func (Stack.NonEmpty val Stack.Empty) = ...
  func (Stack.NonEmpty val1 (Stack.NonEmpty val2 Stack.Empty)) = ...
  </code></pre>
  <p>What I would like to do is doing the pattern matching similar way the Sequence or List does it using an operator like this:</p>
  <pre><code>func :: Stack a -&gt; a
  func (val :&gt; Stack.Empty) = ...
  func (val1 :&gt; val2 :&gt; Stack.Empty) = ...
  </code></pre>
  <p>I know it actually isn't an operator but a data constructor which looks like an operator but I wasn't able to make it work.</p>
  <p>Also I started learning Haskell a few weeks ago.</p>