<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="Up" href="Js.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of class types" rel=Appendix href="index_class_types.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="CSS" rel="Chapter" href="CSS.html"> <link title="Dom" rel="Chapter" href="Dom.html"> <link title="Dom_events" rel="Chapter" href="Dom_events.html"> <link title="Dom_html" rel="Chapter" href="Dom_html.html"> <link title="Event_arrows" rel="Chapter" href="Event_arrows.html"> <link title="File" rel="Chapter" href="File.html"> <link title="Firebug" rel="Chapter" href="Firebug.html"> <link title="Form" rel="Chapter" href="Form.html"> <link title="Js" rel="Chapter" href="Js.html"> <link title="Json" rel="Chapter" href="Json.html"> <link title="Lwt_js" rel="Chapter" href="Lwt_js.html"> <link title="Lwt_js_events" rel="Chapter" href="Lwt_js_events.html"> <link title="Regexp" rel="Chapter" href="Regexp.html"> <link title="Typed_array" rel="Chapter" href="Typed_array.html"> <link title="Url" rel="Chapter" href="Url.html"> <link title="WebGL" rel="Chapter" href="WebGL.html"> <link title="XmlHttpRequest" rel="Chapter" href="XmlHttpRequest.html"><title>Js.OPT</title> </head> <body> <div class="navbar"> <a class="up" href="Js.html" title="Js">Up</a> </div> <h1>Module type <a href="type_Js.OPT.html">Js.OPT</a></h1> <pre><span class="keyword">module type</span> OPT = <code class="code">sig</code> <a href="Js.OPT.html">..</a> <code class="code">end</code></pre><div class="info"> Signatures of a set of standard functions for manipulating optional values.<br> </div> <hr width="100%"> <pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">'a</code> t</span> </pre> <pre><span id="VALempty"><span class="keyword">val</span> empty</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a></code></pre><div class="info"> No value.<br> </div> <pre><span id="VALreturn"><span class="keyword">val</span> return</span> : <code class="type">'a -> 'a <a href="Js.OPT.html#TYPEt">t</a></code></pre><div class="info"> Consider a value as an optional value.<br> </div> <pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> ('a -> 'b) -> 'b <a href="Js.OPT.html#TYPEt">t</a></code></pre><div class="info"> Apply a function to an optional value if it is available. Returns the result of the application.<br> </div> <pre><span id="VALbind"><span class="keyword">val</span> bind</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> ('a -> 'b <a href="Js.OPT.html#TYPEt">t</a>) -> 'b <a href="Js.OPT.html#TYPEt">t</a></code></pre><div class="info"> Apply a function returning an optional value to an optional value<br> </div> <pre><span id="VALtest"><span class="keyword">val</span> test</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> bool</code></pre><div class="info"> Returns <code class="code">true</code> if a value is available, <code class="code">false</code> otherwise.<br> </div> <pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> ('a -> unit) -> unit</code></pre><div class="info"> Apply a function to an optional value if it is available.<br> </div> <pre><span id="VALcase"><span class="keyword">val</span> case</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> (unit -> 'b) -> ('a -> 'b) -> 'b</code></pre><div class="info"> Pattern matching on optional values.<br> </div> <pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> (unit -> 'a) -> 'a</code></pre><div class="info"> Get the value. If no value available, an alternative function is called to get a default value.<br> </div> <pre><span id="VALoption"><span class="keyword">val</span> option</span> : <code class="type">'a option -> 'a <a href="Js.OPT.html#TYPEt">t</a></code></pre><div class="info"> Convert option type.<br> </div> <pre><span id="VALto_option"><span class="keyword">val</span> to_option</span> : <code class="type">'a <a href="Js.OPT.html#TYPEt">t</a> -> 'a option</code></pre><div class="info"> Convert to option type.<br> </div> </body></html>