P

;;
let p = P.char 'h' in
let q = P.char 'w' in
let p = p &lt;|&gt; q in
let v = P.parse_string p &quot;world&quot; in
v = 'w'</code></pre><p><code>p</code> succeeds therefore we return its parsed value <code>'h'</code></p><pre><code>let p = P.char 'h' in
let q = P.char 'w' in
let p = p &lt;|&gt; q in
let v = P.parse_string p &quot;hello&quot; in
v = 'h'</code></pre><p>The parser fails if both <code>p</code> and <code>q</code> fails.</p><pre><code>let p = P.char 'h' in
let q = P.char 'w' in
let p = p &lt;