title: Can I match a data constructor wildcard in Haskell?
body: <p>I have</p>
  
  <pre><code>data Foo = X (String, Int) | A String | B String | C String | D String -- ...
  </code></pre>
  
  <p>and have defined</p>
  
  <pre><code>f (X (s, _)) =s 
  f (A s) = s
  f (B s) = s
  f (C s) = s
  f (D s) = s
  -- ...
  </code></pre>
  
  <p>but would prefer to be able to write something like </p>
  
  <pre><code>f (X (s, _)) =s 
  f (_ s) = s
  </code></pre>
  
  <p>But there seems to be no way to do this (I get a "parse error" associated with the <code>_</code>).</p>
  
  <p>Is there a way to match a data constructor wildcard in Haskell?</p>