title: How to form an OR choice in Parsec that may match many options, but must match at least one option?
body: <p>I'm trying to write a parser in Haskell using the Parsec package. One part of the rules for the input requires the parser to match an option of rules. Out of the rules more than one rule may be match, but <em>at least</em> one rule must match or the parser is expected to produce an error.</p>
  
  <p>Let me provide an example. Assume we have two Parsec rules named <code>first</code> and <code>more</code>. It is possible that:</p>
  
  <ul>
  <li>the input matches <code>first</code> followed by <code>more</code>;</li>
  <li>the input matches only <code>first</code>; or that</li>
  <li>the input matches only <code>more</code>.</li>
  </ul>
  
  <p>In any case, at least one of <code>first</code> or <code>more</code> must match. Any ideas on how to do this? I thought about using the <code>&lt;|&gt;</code> but if I understand it correctly it will only match <em>one</em> of the rules (i.e. the first one that is successful).</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Clarification: If both <code>first</code> and <code>more</code> matches, the result of both must be returned. If only one matches, the returned value of the other can be some null value like <code>Nothing</code>, but it is not allowed to return <code>Nothing</code> for both <code>first</code> and <code>more</code>.</p>