title: How do I know if a (mega)parsec parser may consume input without experimentation - appears not to be documented
body: <p>When using the &lt;|&gt; combinator in a Parsec or Megaparsec parser, 'try' maybe needed to force backtracking in case the first parser fails having consumed input. In Parsec I need to use 'try' when parsing strings:</p>
  <p>λ: parse (try (string &quot;abc&quot;) &lt;|&gt; string &quot;abd&quot;) &quot;&quot; &quot;abd&quot;</p>
  <p>Right &quot;abd&quot;</p>
  <p>Without the 'try', the parse fails as the first parser consumes the 'a', leaving just 'bd' for the second parser which then naturally fails as well.</p>
  <p>In Megaparsec, the 'try' is not needed:</p>
  <p>λ: parse (string &quot;abc&quot; &lt;|&gt; string &quot;abd&quot;) &quot;&quot; &quot;abd&quot;</p>
  <p>Right &quot;abd&quot;</p>
  <p>and so somehow in Megaparsec the string parser helpfully does not consume input when it fails.</p>
  <p>My questions are:</p>
  <ol>
  <li><p>How might I have found out, other than experimenting, that the string parser behaviors are different between Parsec and Megaparsec - I have no seen it documented?</p>
  </li>
  <li><p>How can I easily (that is, without experimentation) tell in general whether a parser consumes input if it fails?</p>
  </li>
  </ol>
  <p>Thank you.</p>