span><span><span class="type-var">'a</span> option</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>optional p</code> parses <code>Some a</code> if successful and <code>None</code> otherwise. <code>a</code> is the parsed value of <code>p</code>.</p><p>Examples</p><pre><code>module P = Reparse.String
open P

;;
let p = P.(optional (char 'a')) in
let v = P.parse_string p &quot;ab&quot; in
v = Some 'a'

;;
let p = P.(optional (char 'z')) in
let v = P.parse_string p &quot;