Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2845

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>DataCon</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_DataCon.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ghc-7.4.2: The GHC API</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">DataCon</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Main data types
</a><ul><li><a href="#g:2">Type construction
</a></li><li><a href="#g:3">Type deconstruction
</a></li><li><a href="#g:4">Predicates on DataCons
</a></li></ul></li><li><a href="#g:5">Splitting product types
</a></li></ul></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:DataCon">DataCon</a> </li><li class="src short"><span class="keyword">data</span>  <a href="#t:DataConIds">DataConIds</a>  = <a href="#v:DCIds">DCIds</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Var.html#t:Id">Id</a>) <a href="Var.html#t:Id">Id</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:ConTag">ConTag</a> = <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:mkDataCon">mkDataCon</a> :: <a href="Name.html#t:Name">Name</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a> -&gt; [<a href="BasicTypes.html#t:HsBang">HsBang</a>] -&gt; [<a href="TyCon.html#t:FieldLabel">FieldLabel</a>] -&gt; [<a href="Var.html#t:TyVar">TyVar</a>] -&gt; [<a href="Var.html#t:TyVar">TyVar</a>] -&gt; [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="DataCon.html#t:DataConIds">DataConIds</a> -&gt; <a href="DataCon.html#t:DataCon">DataCon</a></li><li class="src short"><a href="#v:fIRST_TAG">fIRST_TAG</a> :: <a href="DataCon.html#t:ConTag">ConTag</a></li><li class="src short"><a href="#v:dataConRepType">dataConRepType</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:dataConSig">dataConSig</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; ([<a href="Var.html#t:TyVar">TyVar</a>], <a href="Type.html#t:ThetaType">ThetaType</a>, [<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:dataConFullSig">dataConFullSig</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; ([<a href="Var.html#t:TyVar">TyVar</a>], [<a href="Var.html#t:TyVar">TyVar</a>], [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)], <a href="Type.html#t:ThetaType">ThetaType</a>, [<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:dataConName">dataConName</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Name.html#t:Name">Name</a></li><li class="src short"><a href="#v:dataConIdentity">dataConIdentity</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="../base-4.5.1.0/Data-Word.html#t:Word8">Word8</a>]</li><li class="src short"><a href="#v:dataConTag">dataConTag</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="DataCon.html#t:ConTag">ConTag</a></li><li class="src short"><a href="#v:dataConTyCon">dataConTyCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:dataConOrigTyCon">dataConOrigTyCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:dataConUserType">dataConUserType</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:dataConUnivTyVars">dataConUnivTyVars</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</li><li class="src short"><a href="#v:dataConExTyVars">dataConExTyVars</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</li><li class="src short"><a href="#v:dataConAllTyVars">dataConAllTyVars</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</li><li class="src short"><a href="#v:dataConEqSpec">dataConEqSpec</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)]</li><li class="src short"><a href="#v:eqSpecPreds">eqSpecPreds</a> :: [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></li><li class="src short"><a href="#v:dataConTheta">dataConTheta</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></li><li class="src short"><a href="#v:dataConStupidTheta">dataConStupidTheta</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></li><li class="src short"><a href="#v:dataConInstArgTys">dataConInstArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:dataConOrigArgTys">dataConOrigArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:dataConOrigResTy">dataConOrigResTy</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:dataConInstOrigArgTys">dataConInstOrigArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:dataConRepArgTys">dataConRepArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:dataConFieldLabels">dataConFieldLabels</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="TyCon.html#t:FieldLabel">FieldLabel</a>]</li><li class="src short"><a href="#v:dataConFieldType">dataConFieldType</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="TyCon.html#t:FieldLabel">FieldLabel</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:dataConStrictMarks">dataConStrictMarks</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="BasicTypes.html#t:HsBang">HsBang</a>]</li><li class="src short"><a href="#v:dataConExStricts">dataConExStricts</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="BasicTypes.html#t:HsBang">HsBang</a>]</li><li class="src short"><a href="#v:dataConSourceArity">dataConSourceArity</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="BasicTypes.html#t:Arity">Arity</a></li><li class="src short"><a href="#v:dataConRepArity">dataConRepArity</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:dataConIsInfix">dataConIsInfix</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:dataConWorkId">dataConWorkId</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Var.html#t:Id">Id</a></li><li class="src short"><a href="#v:dataConWrapId">dataConWrapId</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Var.html#t:Id">Id</a></li><li class="src short"><a href="#v:dataConWrapId_maybe">dataConWrapId_maybe</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Var.html#t:Id">Id</a></li><li class="src short"><a href="#v:dataConImplicitIds">dataConImplicitIds</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:Id">Id</a>]</li><li class="src short"><a href="#v:dataConRepStrictness">dataConRepStrictness</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="BasicTypes.html#t:StrictnessMark">StrictnessMark</a>]</li><li class="src short"><a href="#v:isNullarySrcDataCon">isNullarySrcDataCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isNullaryRepDataCon">isNullaryRepDataCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isTupleCon">isTupleCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isUnboxedTupleCon">isUnboxedTupleCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isVanillaDataCon">isVanillaDataCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:classDataCon">classDataCon</a> :: <a href="Class.html#t:Class">Class</a> -&gt; <a href="DataCon.html#t:DataCon">DataCon</a></li><li class="src short"><a href="#v:dataConCannotMatch">dataConCannotMatch</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:splitProductType_maybe">splitProductType_maybe</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</li><li class="src short"><a href="#v:splitProductType">splitProductType</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</li><li class="src short"><a href="#v:deepSplitProductType">deepSplitProductType</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</li><li class="src short"><a href="#v:deepSplitProductType_maybe">deepSplitProductType_maybe</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</li></ul></div><div id="interface"><h1 id="g:1">Main data types
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:DataCon" class="def">DataCon</a>  </p><div class="doc"><p>A data constructor
</p></div><div class="subs instances"><p id="control.i:DataCon" class="caption collapser" onclick="toggleSection('i:DataCon')">Instances</p><div id="section.i:DataCon" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Data.html#t:Data">Data</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Show.html#t:Show">Show</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Unique.html#t:Uniquable">Uniquable</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Name.html#t:NamedThing">NamedThing</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:DataConIds" class="def">DataConIds</a>  </p><div class="doc"><p>Contains the Ids of the data constructor functions
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:DCIds" class="def">DCIds</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Var.html#t:Id">Id</a>) <a href="Var.html#t:Id">Id</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ConTag" class="def">ConTag</a> = <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a></p><div class="doc"><p>Type of the tags associated with each constructor possibility
</p></div></div><h2 id="g:2">Type construction
</h2><div class="top"><p class="src"><a name="v:mkDataCon" class="def">mkDataCon</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Name.html#t:Name">Name</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>Is the constructor declared infix?
</p></td></tr><tr><td class="src">-&gt; [<a href="BasicTypes.html#t:HsBang">HsBang</a>]</td><td class="doc"><p>Strictness annotations written in the source file
</p></td></tr><tr><td class="src">-&gt; [<a href="TyCon.html#t:FieldLabel">FieldLabel</a>]</td><td class="doc"><p>Field labels for the constructor, if it is a record, 
   otherwise empty
</p></td></tr><tr><td class="src">-&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</td><td class="doc"><p>Universally quantified type variables
</p></td></tr><tr><td class="src">-&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</td><td class="doc"><p>Existentially quantified type variables
</p></td></tr><tr><td class="src">-&gt; [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)]</td><td class="doc"><p>GADT equalities
</p></td></tr><tr><td class="src">-&gt; <a href="Type.html#t:ThetaType">ThetaType</a></td><td class="doc"><p>Theta-type occuring before the arguments proper
</p></td></tr><tr><td class="src">-&gt; [<a href="Type.html#t:Type">Type</a>]</td><td class="doc"><p>Original argument types
</p></td></tr><tr><td class="src">-&gt; <a href="Type.html#t:Type">Type</a></td><td class="doc"><p>Original result type
</p></td></tr><tr><td class="src">-&gt; <a href="TyCon.html#t:TyCon">TyCon</a></td><td class="doc"><p>Representation type constructor
</p></td></tr><tr><td class="src">-&gt; <a href="Type.html#t:ThetaType">ThetaType</a></td><td class="doc"><p>The <a href="stupid theta.html">stupid theta</a>, context of the data declaration 
   e.g. <code>data Eq a =&gt; T a ...</code>
</p></td></tr><tr><td class="src">-&gt; <a href="DataCon.html#t:DataConIds">DataConIds</a></td><td class="doc"><p>The Ids of the actual builder functions
</p></td></tr><tr><td class="src">-&gt; <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Build a new data constructor
</p></div></div><div class="top"><p class="src"><a name="v:fIRST_TAG" class="def">fIRST_TAG</a> :: <a href="DataCon.html#t:ConTag">ConTag</a></p><div class="doc"><p>Tags are allocated from here for real constructors
</p></div></div><h2 id="g:3">Type deconstruction
</h2><div class="top"><p class="src"><a name="v:dataConRepType" class="def">dataConRepType</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>The representation type of the data constructor, i.e. the sort
 type that will represent values of this type at runtime
</p></div></div><div class="top"><p class="src"><a name="v:dataConSig" class="def">dataConSig</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; ([<a href="Var.html#t:TyVar">TyVar</a>], <a href="Type.html#t:ThetaType">ThetaType</a>, [<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>The &quot;signature&quot; of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> returns, in order:
</p><p>1) The result of <code><a href="DataCon.html#v:dataConAllTyVars">dataConAllTyVars</a></code>,
</p><p>2) All the <code><a href="Type.html#t:ThetaType">ThetaType</a></code>s relating to the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> (coercion, dictionary, implicit
    parameter - whatever)
</p><p>3) The type arguments to the constructor
</p><p>4) The <em>original</em> result type of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConFullSig" class="def">dataConFullSig</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; ([<a href="Var.html#t:TyVar">TyVar</a>], [<a href="Var.html#t:TyVar">TyVar</a>], [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)], <a href="Type.html#t:ThetaType">ThetaType</a>, [<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>The &quot;full signature&quot; of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> returns, in order:
</p><p>1) The result of <code><a href="DataCon.html#v:dataConUnivTyVars">dataConUnivTyVars</a></code>
</p><p>2) The result of <code><a href="DataCon.html#v:dataConExTyVars">dataConExTyVars</a></code>
</p><p>3) The result of <code><a href="DataCon.html#v:dataConEqSpec">dataConEqSpec</a></code>
</p><p>4) The result of <code>dataConDictTheta</code>
</p><p>5) The original argument types to the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> (i.e. before 
    any change of the representation of the type)
</p><p>6) The original result type of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConName" class="def">dataConName</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Name.html#t:Name">Name</a></p><div class="doc"><p>The <code><a href="Name.html#t:Name">Name</a></code> of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code>, giving it a unique, rooted identification
</p></div></div><div class="top"><p class="src"><a name="v:dataConIdentity" class="def">dataConIdentity</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="../base-4.5.1.0/Data-Word.html#t:Word8">Word8</a>]</p><div class="doc"><p>The string <code>package:module.name</code> identifying a constructor, which is attached
 to its info table and used by the GHCi debugger and the heap profiler
</p></div></div><div class="top"><p class="src"><a name="v:dataConTag" class="def">dataConTag</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="DataCon.html#t:ConTag">ConTag</a></p><div class="doc"><p>The tag used for ordering <code><a href="DataCon.html#t:DataCon">DataCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:dataConTyCon" class="def">dataConTyCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>The type constructor that we are building via this data constructor
</p></div></div><div class="top"><p class="src"><a name="v:dataConOrigTyCon" class="def">dataConOrigTyCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>The original type constructor used in the definition of this data
 constructor.  In case of a data family instance, that will be the family
 type constructor.
</p></div></div><div class="top"><p class="src"><a name="v:dataConUserType" class="def">dataConUserType</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>The user-declared type of the data constructor
 in the nice-to-read form:
</p><pre> T :: forall a b. a -&gt; b -&gt; T [a]
</pre><p>rather than:
</p><pre> T :: forall a c. forall b. (c~[a]) =&gt; a -&gt; b -&gt; T c
</pre><p>NB: If the constructor is part of a data instance, the result type
 mentions the family tycon, not the internal one.
</p></div></div><div class="top"><p class="src"><a name="v:dataConUnivTyVars" class="def">dataConUnivTyVars</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</p><div class="doc"><p>The universally-quantified type variables of the constructor
</p></div></div><div class="top"><p class="src"><a name="v:dataConExTyVars" class="def">dataConExTyVars</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</p><div class="doc"><p>The existentially-quantified type variables of the constructor
</p></div></div><div class="top"><p class="src"><a name="v:dataConAllTyVars" class="def">dataConAllTyVars</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:TyVar">TyVar</a>]</p><div class="doc"><p>Both the universal and existentiatial type variables of the constructor
</p></div></div><div class="top"><p class="src"><a name="v:dataConEqSpec" class="def">dataConEqSpec</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)]</p><div class="doc"><p>Equalities derived from the result type of the data constructor, as written
 by the programmer in any GADT declaration
</p></div></div><div class="top"><p class="src"><a name="v:eqSpecPreds" class="def">eqSpecPreds</a> :: [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></p></div><div class="top"><p class="src"><a name="v:dataConTheta" class="def">dataConTheta</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></p><div class="doc"><p>The *full* constraints on the constructor type
</p></div></div><div class="top"><p class="src"><a name="v:dataConStupidTheta" class="def">dataConStupidTheta</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></p><div class="doc"><p>The &quot;stupid theta&quot; of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code>, such as <code>data Eq a</code> in:
</p><pre> data Eq a =&gt; T a = ...
</pre></div></div><div class="top"><p class="src"><a name="v:dataConInstArgTys" class="def">dataConInstArgTys</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc"><p>A datacon with no existentials or equality constraints
 However, it can have a dcTheta (notably it can be a 
 class dictionary, with superclasses)
</p></td></tr><tr><td class="src">-&gt; [<a href="Type.html#t:Type">Type</a>]</td><td class="doc"><p>Instantiated at these types
</p></td></tr><tr><td class="src">-&gt; [<a href="Type.html#t:Type">Type</a>]</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Finds the instantiated types of the arguments required to construct a <code><a href="DataCon.html#t:DataCon">DataCon</a></code> representation
 NB: these INCLUDE any dictionary args
     but EXCLUDE the data-declaration context, which is discarded
 It's all post-flattening etc; this is a representation type
</p></div></div><div class="top"><p class="src"><a name="v:dataConOrigArgTys" class="def">dataConOrigArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>]</p><div class="doc"><p>Returns the argument types of the wrapper, excluding all dictionary arguments
 and without substituting for any type variables
</p></div></div><div class="top"><p class="src"><a name="v:dataConOrigResTy" class="def">dataConOrigResTy</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:dataConInstOrigArgTys" class="def">dataConInstOrigArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</p><div class="doc"><p>Returns just the instantiated <em>value</em> argument types of a <code><a href="DataCon.html#t:DataCon">DataCon</a></code>,
 (excluding dictionary args)
</p></div></div><div class="top"><p class="src"><a name="v:dataConRepArgTys" class="def">dataConRepArgTys</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>]</p><div class="doc"><p>Returns the arg types of the worker, including all dictionaries, after any 
 flattening has been done and without substituting for any type variables
</p></div></div><div class="top"><p class="src"><a name="v:dataConFieldLabels" class="def">dataConFieldLabels</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="TyCon.html#t:FieldLabel">FieldLabel</a>]</p><div class="doc"><p>The labels for the fields of this particular <code><a href="DataCon.html#t:DataCon">DataCon</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConFieldType" class="def">dataConFieldType</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="TyCon.html#t:FieldLabel">FieldLabel</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Extract the type for any given labelled field of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConStrictMarks" class="def">dataConStrictMarks</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="BasicTypes.html#t:HsBang">HsBang</a>]</p><div class="doc"><p>The strictness markings decided on by the compiler.  Does not include those for
 existential dictionaries.  The list is in one-to-one correspondence with the arity of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConExStricts" class="def">dataConExStricts</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="BasicTypes.html#t:HsBang">HsBang</a>]</p><div class="doc"><p>Strictness of evidence arguments to the wrapper function
</p></div></div><div class="top"><p class="src"><a name="v:dataConSourceArity" class="def">dataConSourceArity</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="BasicTypes.html#t:Arity">Arity</a></p><div class="doc"><p>Source-level arity of the data constructor
</p></div></div><div class="top"><p class="src"><a name="v:dataConRepArity" class="def">dataConRepArity</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a></p><div class="doc"><p>Gives the number of actual fields in the <em>representation</em> of the 
 data constructor. This may be more than appear in the source code;
 the extra ones are the existentially quantified dictionaries
</p></div></div><div class="top"><p class="src"><a name="v:dataConIsInfix" class="def">dataConIsInfix</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Should the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> be presented infix?
</p></div></div><div class="top"><p class="src"><a name="v:dataConWorkId" class="def">dataConWorkId</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Var.html#t:Id">Id</a></p><div class="doc"><p>Get the Id of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> worker: a function that is the <a href="actual.html">actual</a>
 constructor and has no top level binding in the program. The type may
 be different from the obvious one written in the source program. Panics
 if there is no such <code><a href="Var.html#t:Id">Id</a></code> for this <code><a href="DataCon.html#t:DataCon">DataCon</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConWrapId" class="def">dataConWrapId</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="Var.html#t:Id">Id</a></p><div class="doc"><p>Returns an Id which looks like the Haskell-source constructor by using
 the wrapper if it exists (see <code><a href="DataCon.html#v:dataConWrapId_maybe">dataConWrapId_maybe</a></code>) and failing over to
 the worker (see <code><a href="DataCon.html#v:dataConWorkId">dataConWorkId</a></code>)
</p></div></div><div class="top"><p class="src"><a name="v:dataConWrapId_maybe" class="def">dataConWrapId_maybe</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Var.html#t:Id">Id</a></p><div class="doc"><p>Get the Id of the <code><a href="DataCon.html#t:DataCon">DataCon</a></code> wrapper: a function that wraps the <a href="actual.html">actual</a>
 constructor so it has the type visible in the source program: c.f. <code><a href="DataCon.html#v:dataConWorkId">dataConWorkId</a></code>.
 Returns Nothing if there is no wrapper, which occurs for an algebraic data constructor 
 and also for a newtype (whose constructor is inlined compulsorily)
</p></div></div><div class="top"><p class="src"><a name="v:dataConImplicitIds" class="def">dataConImplicitIds</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="Var.html#t:Id">Id</a>]</p><div class="doc"><p>Find all the <code><a href="Var.html#t:Id">Id</a></code>s implicitly brought into scope by the data constructor. Currently,
 the union of the <code><a href="DataCon.html#v:dataConWorkId">dataConWorkId</a></code> and the <code><a href="DataCon.html#v:dataConWrapId">dataConWrapId</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:dataConRepStrictness" class="def">dataConRepStrictness</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; [<a href="BasicTypes.html#t:StrictnessMark">StrictnessMark</a>]</p><div class="doc"><p>Give the demands on the arguments of a
 Core constructor application (Con dc args)
</p></div></div><h2 id="g:4">Predicates on DataCons
</h2><div class="top"><p class="src"><a name="v:isNullarySrcDataCon" class="def">isNullarySrcDataCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Return whether there are any argument types for this <code><a href="DataCon.html#t:DataCon">DataCon</a></code>s original source type
</p></div></div><div class="top"><p class="src"><a name="v:isNullaryRepDataCon" class="def">isNullaryRepDataCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Return whether there are any argument types for this <code><a href="DataCon.html#t:DataCon">DataCon</a></code>s runtime representation type
</p></div></div><div class="top"><p class="src"><a name="v:isTupleCon" class="def">isTupleCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isUnboxedTupleCon" class="def">isUnboxedTupleCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isVanillaDataCon" class="def">isVanillaDataCon</a> :: <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Vanilla <code><a href="DataCon.html#t:DataCon">DataCon</a></code>s are those that are nice boring Haskell 98 constructors
</p></div></div><div class="top"><p class="src"><a name="v:classDataCon" class="def">classDataCon</a> :: <a href="Class.html#t:Class">Class</a> -&gt; <a href="DataCon.html#t:DataCon">DataCon</a></p></div><div class="top"><p class="src"><a name="v:dataConCannotMatch" class="def">dataConCannotMatch</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="DataCon.html#t:DataCon">DataCon</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><h1 id="g:5">Splitting product types
</h1><div class="top"><p class="src"><a name="v:splitProductType_maybe" class="def">splitProductType_maybe</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Type.html#t:Type">Type</a></td><td class="doc"><p>A product type, perhaps
</p></td></tr><tr><td class="src">-&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Extract the type constructor, type argument, data constructor and it's
 <em>representation</em> argument types from a type if it is a product type.
</p><p>Precisely, we return <code>Just</code> for any type that is all of:
</p><ul><li> Concrete (i.e. constructors visible)
</li><li> Single-constructor
</li><li> Not existentially quantified
</li></ul><p>Whether the type is a <code>data</code> type or a <code>newtype</code>
</p></div></div><div class="top"><p class="src"><a name="v:splitProductType" class="def">splitProductType</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</p><div class="doc"><p>As <code><a href="DataCon.html#v:splitProductType_maybe">splitProductType_maybe</a></code>, but panics if the <code><a href="Type.html#t:Type">Type</a></code> is not a product type
</p></div></div><div class="top"><p class="src"><a name="v:deepSplitProductType" class="def">deepSplitProductType</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</p><div class="doc"><p>As <code><a href="DataCon.html#v:deepSplitProductType_maybe">deepSplitProductType_maybe</a></code>, but panics if the <code><a href="Type.html#t:Type">Type</a></code> is not a product type
</p></div></div><div class="top"><p class="src"><a name="v:deepSplitProductType_maybe" class="def">deepSplitProductType_maybe</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="TyCon.html#t:TyCon">TyCon</a>, [<a href="Type.html#t:Type">Type</a>], <a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>])</p><div class="doc"><p>As <code><a href="DataCon.html#v:splitProductType_maybe">splitProductType_maybe</a></code>, but in turn instantiates the <code><a href="TyCon.html#t:TyCon">TyCon</a></code> returned
 and hence recursively tries to unpack it as far as it able to
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>