<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Option type - Page 7 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=option_type&amp;p=6">1.Previous</a><br />
<a accesskey="3" href="page.php?w=option_type&amp;p=8">3.Next</a>
</p>

<p>Example usage:<syntaxhighlight lang="ada">   package Optional_Integers is new Optional_Type      (Element_Type => Integer);   Foo : Optional_Integers.Optional :=      (Has_Element => True, Element => 5);   Bar : Optional_Integers.Optional :=       (Has_Element => False);</syntaxhighlight></p>

<p><big> Agda </big></p>
<p>In Agda, the option type is named  with variants  and .</p>

<p><big> ATS </big></p>
<p>In ATS, the option type is defined as</p>

<p><syntaxhighlight lang="ocaml">datatype option_t0ype_bool_type (a: t@ype+, bool) = 	| Some(a, true) of a 	| None(a, false)stadef option = option_t0ype_bool_typetypedef Option(a: t@ype) = [b:bool] option(a, b)</syntaxhighlight></p><p>
<a accesskey="1" href="page.php?w=option_type&amp;p=6">1.Previous</a><br />
<a accesskey="3" href="page.php?w=option_type&amp;p=8">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
