Sophie

Sophie

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

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>Type</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_Type.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">Type</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Main data types representing Types
</a><ul><li><a href="#g:2">Constructing and deconstructing types
</a></li><li><a href="#g:3">Common type constructors
</a></li><li><a href="#g:4">Predicates on types
</a></li></ul></li><li><a href="#g:5">Main data types representing Kinds
</a><ul><li><a href="#g:6">Finding the kind of a type
</a></li><li><a href="#g:7">Common Kinds and SuperKinds
</a></li><li><a href="#g:8">Common Kind type constructors
</a></li></ul></li><li><a href="#g:9">Type free variables
</a></li><li><a href="#g:10">Type comparison
</a></li><li><a href="#g:11">Forcing evaluation of types
</a></li><li><a href="#g:12">Other views onto Types
</a></li><li><a href="#g:13">Type representation for the code generator
</a></li><li><a href="#g:14">Main type substitution data types
</a><ul><li><a href="#g:15">Manipulating type substitutions
</a></li><li><a href="#g:16">Performing substitution on types and kinds
</a></li></ul></li><li><a href="#g:17">Pretty-printing
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Main functions for manipulating types and type-related things
</p></div></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:TyThing">TyThing</a> <ul class="subs"><li>= <a href="#v:AnId">AnId</a> <a href="Var.html#t:Id">Id</a>  </li><li>| <a href="#v:ADataCon">ADataCon</a> <a href="DataCon.html#t:DataCon">DataCon</a>  </li><li>| <a href="#v:ATyCon">ATyCon</a> <a href="TyCon.html#t:TyCon">TyCon</a>  </li><li>| <a href="#v:ACoAxiom">ACoAxiom</a> <a href="TyCon.html#t:CoAxiom">CoAxiom</a>  </li></ul></li><li class="src short"><span class="keyword">data</span>  <a href="#t:Type">Type</a> </li><li class="src short"><span class="keyword">type</span> <a href="#t:KindOrType">KindOrType</a> = <a href="Type.html#t:Type">Type</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:PredType">PredType</a> = <a href="Type.html#t:Type">Type</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:ThetaType">ThetaType</a> = [<a href="Type.html#t:PredType">PredType</a>]</li><li class="src short"><span class="keyword">data</span>  <a href="#t:Var">Var</a> </li><li class="src short"><span class="keyword">type</span> <a href="#t:TyVar">TyVar</a> = <a href="Type.html#t:Var">Var</a></li><li class="src short"><a href="#v:isTyVar">isTyVar</a> :: <a href="Type.html#t:Var">Var</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:mkTyVarTy">mkTyVarTy</a> :: <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:mkTyVarTys">mkTyVarTys</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:getTyVar">getTyVar</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="Type.html#t:TyVar">TyVar</a></li><li class="src short"><a href="#v:getTyVar_maybe">getTyVar_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="Type.html#t:TyVar">TyVar</a></li><li class="src short"><a href="#v:mkAppTy">mkAppTy</a> :: <a href="Type.html#t:Type">Type</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:mkAppTys">mkAppTys</a> :: <a href="Type.html#t:Type">Type</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:splitAppTy">splitAppTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:splitAppTys">splitAppTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; (<a href="Type.html#t:Type">Type</a>, [<a href="Type.html#t:Type">Type</a>])</li><li class="src short"><a href="#v:splitAppTy_maybe">splitAppTy_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="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:repSplitAppTy_maybe">repSplitAppTy_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="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:mkFunTy">mkFunTy</a> :: <a href="Type.html#t:Type">Type</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:mkFunTys">mkFunTys</a> :: [<a href="Type.html#t:Type">Type</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:splitFunTy">splitFunTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:splitFunTy_maybe">splitFunTy_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="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:splitFunTys">splitFunTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; ([<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:splitFunTysN">splitFunTysN</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; ([<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:funResultTy">funResultTy</a> :: <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:funArgTy">funArgTy</a> :: <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:zipFunTys">zipFunTys</a> :: <a href="Outputable.html#t:Outputable">Outputable</a> a =&gt; [a] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; ([(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:mkTyConApp">mkTyConApp</a> :: <a href="TyCon.html#t:TyCon">TyCon</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:mkTyConTy">mkTyConTy</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:tyConAppTyCon_maybe">tyConAppTyCon_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></li><li class="src short"><a href="#v:tyConAppArgs_maybe">tyConAppArgs_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="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:tyConAppTyCon">tyConAppTyCon</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:tyConAppArgs">tyConAppArgs</a> :: <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:splitTyConApp_maybe">splitTyConApp_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>])</li><li class="src short"><a href="#v:splitTyConApp">splitTyConApp</a> :: <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>])</li><li class="src short"><a href="#v:tyConAppArgN">tyConAppArgN</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</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:mkForAllTy">mkForAllTy</a> :: <a href="Type.html#t:TyVar">TyVar</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:mkForAllTys">mkForAllTys</a> :: [<a href="Type.html#t:TyVar">TyVar</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:splitForAllTy_maybe">splitForAllTy_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="Type.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:splitForAllTys">splitForAllTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; ([<a href="Type.html#t:TyVar">TyVar</a>], <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:mkPiKinds">mkPiKinds</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:mkPiType">mkPiType</a> :: <a href="Type.html#t:Var">Var</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:mkPiTypes">mkPiTypes</a> :: [<a href="Type.html#t:Var">Var</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:applyTy">applyTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:KindOrType">KindOrType</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:applyTys">applyTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; [<a href="Type.html#t:KindOrType">KindOrType</a>] -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:applyTysD">applyTysD</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="Type.html#t:Type">Type</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:isForAllTy">isForAllTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:dropForAlls">dropForAlls</a> :: <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:newTyConInstRhs">newTyConInstRhs</a> :: <a href="TyCon.html#t:TyCon">TyCon</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:carefullySplitNewType_maybe">carefullySplitNewType_maybe</a> :: <a href="NameSet.html#t:NameSet">NameSet</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; [<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="NameSet.html#t:NameSet">NameSet</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:mkFamilyTyConApp">mkFamilyTyConApp</a> :: <a href="TyCon.html#t:TyCon">TyCon</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:isDictLikeTy">isDictLikeTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:mkEqPred">mkEqPred</a> :: (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>) -&gt; <a href="Type.html#t:PredType">PredType</a></li><li class="src short"><a href="#v:mkClassPred">mkClassPred</a> :: <a href="Class.html#t:Class">Class</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:PredType">PredType</a></li><li class="src short"><a href="#v:mkIPPred">mkIPPred</a> :: <a href="BasicTypes.html#t:IPName">IPName</a> <a href="Name.html#t:Name">Name</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:PredType">PredType</a></li><li class="src short"><a href="#v:noParenPred">noParenPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isClassPred">isClassPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isEqPred">isEqPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isIPPred">isIPPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:mkPrimEqType">mkPrimEqType</a> :: (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>) -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:PredTree">PredTree</a> <ul class="subs"><li>= <a href="#v:ClassPred">ClassPred</a> <a href="Class.html#t:Class">Class</a> [<a href="Type.html#t:Type">Type</a>]  </li><li>| <a href="#v:EqPred">EqPred</a> <a href="Type.html#t:Type">Type</a> <a href="Type.html#t:Type">Type</a>  </li><li>| <a href="#v:IPPred">IPPred</a> (<a href="BasicTypes.html#t:IPName">IPName</a> <a href="Name.html#t:Name">Name</a>) <a href="Type.html#t:Type">Type</a>  </li><li>| <a href="#v:TuplePred">TuplePred</a> [<a href="Type.html#t:PredType">PredType</a>]  </li><li>| <a href="#v:IrredPred">IrredPred</a> <a href="Type.html#t:PredType">PredType</a>  </li></ul></li><li class="src short"><a href="#v:predTreePredType">predTreePredType</a> :: <a href="Type.html#t:PredTree">PredTree</a> -&gt; <a href="Type.html#t:PredType">PredType</a></li><li class="src short"><a href="#v:classifyPredType">classifyPredType</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredTree">PredTree</a></li><li class="src short"><a href="#v:getClassPredTys">getClassPredTys</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; (<a href="Class.html#t:Class">Class</a>, [<a href="Type.html#t:Type">Type</a>])</li><li class="src short"><a href="#v:getClassPredTys_maybe">getClassPredTys_maybe</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Class.html#t:Class">Class</a>, [<a href="Type.html#t:Type">Type</a>])</li><li class="src short"><a href="#v:getEqPredTys">getEqPredTys</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:getEqPredTys_maybe">getEqPredTys_maybe</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</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:getIPPredTy_maybe">getIPPredTy_maybe</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="BasicTypes.html#t:IPName">IPName</a> <a href="Name.html#t:Name">Name</a>, <a href="Type.html#t:Type">Type</a>)</li><li class="src short"><a href="#v:funTyCon">funTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:isTyVarTy">isTyVarTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isFunTy">isFunTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isDictTy">isDictTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isPredTy">isPredTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isKindTy">isKindTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isUnLiftedType">isUnLiftedType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isUnboxedTupleType">isUnboxedTupleType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isAlgType">isAlgType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isClosedAlgType">isClosedAlgType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isPrimitiveType">isPrimitiveType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isStrictType">isStrictType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:Kind">Kind</a> = <a href="Type.html#t:Type">Type</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:SimpleKind">SimpleKind</a> = <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:MetaKindVar">MetaKindVar</a> = <a href="Type.html#t:TyVar">TyVar</a></li><li class="src short"><a href="#v:typeKind">typeKind</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:anyKind">anyKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:liftedTypeKind">liftedTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:unliftedTypeKind">unliftedTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:openTypeKind">openTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:argTypeKind">argTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:ubxTupleKind">ubxTupleKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:constraintKind">constraintKind</a> :: <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:tySuperKind">tySuperKind</a> :: SuperKind</li><li class="src short"><a href="#v:liftedTypeKindTyCon">liftedTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:openTypeKindTyCon">openTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:unliftedTypeKindTyCon">unliftedTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:argTypeKindTyCon">argTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:ubxTupleKindTyCon">ubxTupleKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:constraintKindTyCon">constraintKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:anyKindTyCon">anyKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></li><li class="src short"><a href="#v:tyVarsOfType">tyVarsOfType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="VarSet.html#t:VarSet">VarSet</a></li><li class="src short"><a href="#v:tyVarsOfTypes">tyVarsOfTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="VarSet.html#t:TyVarSet">TyVarSet</a></li><li class="src short"><a href="#v:expandTypeSynonyms">expandTypeSynonyms</a> :: <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:typeSize">typeSize</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:varSetElemsKvsFirst">varSetElemsKvsFirst</a> :: <a href="VarSet.html#t:VarSet">VarSet</a> -&gt; [<a href="Type.html#t:TyVar">TyVar</a>]</li><li class="src short"><a href="#v:sortQuantVars">sortQuantVars</a> :: [<a href="Type.html#t:Var">Var</a>] -&gt; [<a href="Type.html#t:Var">Var</a>]</li><li class="src short"><a href="#v:eqType">eqType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:eqTypeX">eqTypeX</a> :: <a href="VarEnv.html#t:RnEnv2">RnEnv2</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:eqTypes">eqTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:cmpType">cmpType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></li><li class="src short"><a href="#v:cmpTypes">cmpTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></li><li class="src short"><a href="#v:eqPred">eqPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:eqPredX">eqPredX</a> :: <a href="VarEnv.html#t:RnEnv2">RnEnv2</a> -&gt; <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:cmpPred">cmpPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></li><li class="src short"><a href="#v:eqKind">eqKind</a> :: <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:seqType">seqType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; ()</li><li class="src short"><a href="#v:seqTypes">seqTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; ()</li><li class="src short"><a href="#v:coreView">coreView</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="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:tcView">tcView</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="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:repType">repType</a> :: <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:deepRepType">deepRepType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:PrimRep">PrimRep</a> <ul class="subs"><li>= <a href="#v:VoidRep">VoidRep</a>  </li><li>| <a href="#v:PtrRep">PtrRep</a>  </li><li>| <a href="#v:IntRep">IntRep</a>  </li><li>| <a href="#v:WordRep">WordRep</a>  </li><li>| <a href="#v:Int64Rep">Int64Rep</a>  </li><li>| <a href="#v:Word64Rep">Word64Rep</a>  </li><li>| <a href="#v:AddrRep">AddrRep</a>  </li><li>| <a href="#v:FloatRep">FloatRep</a>  </li><li>| <a href="#v:DoubleRep">DoubleRep</a>  </li></ul></li><li class="src short"><a href="#v:typePrimRep">typePrimRep</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:PrimRep">PrimRep</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:TvSubstEnv">TvSubstEnv</a> = <a href="VarEnv.html#t:TyVarEnv">TyVarEnv</a> <a href="Type.html#t:Type">Type</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:TvSubst">TvSubst</a>  = <a href="#v:TvSubst">TvSubst</a> <a href="VarEnv.html#t:InScopeSet">InScopeSet</a> <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></li><li class="src short"><a href="#v:emptyTvSubstEnv">emptyTvSubstEnv</a> :: <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></li><li class="src short"><a href="#v:emptyTvSubst">emptyTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:mkTvSubst">mkTvSubst</a> :: <a href="VarEnv.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:mkOpenTvSubst">mkOpenTvSubst</a> :: <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:zipOpenTvSubst">zipOpenTvSubst</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:zipTopTvSubst">zipTopTvSubst</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:mkTopTvSubst">mkTopTvSubst</a> :: [(<a href="Type.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:notElemTvSubst">notElemTvSubst</a> :: <a href="Var.html#t:CoVar">CoVar</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:getTvSubstEnv">getTvSubstEnv</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></li><li class="src short"><a href="#v:setTvSubstEnv">setTvSubstEnv</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:zapTvSubstEnv">zapTvSubstEnv</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:getTvInScope">getTvInScope</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="VarEnv.html#t:InScopeSet">InScopeSet</a></li><li class="src short"><a href="#v:extendTvInScope">extendTvInScope</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:Var">Var</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:extendTvInScopeList">extendTvInScopeList</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:Var">Var</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:extendTvSubst">extendTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:extendTvSubstList">extendTvSubstList</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:isInScope">isInScope</a> :: <a href="Type.html#t:Var">Var</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:composeTvSubst">composeTvSubst</a> :: <a href="VarEnv.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></li><li class="src short"><a href="#v:zipTyEnv">zipTyEnv</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></li><li class="src short"><a href="#v:isEmptyTvSubst">isEmptyTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:unionTvSubst">unionTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></li><li class="src short"><a href="#v:substTy">substTy</a> :: <a href="Type.html#t:TvSubst">TvSubst</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:substTys">substTys</a> :: <a href="Type.html#t:TvSubst">TvSubst</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:substTyWith">substTyWith</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</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:substTysWith">substTysWith</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</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:substTheta">substTheta</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></li><li class="src short"><a href="#v:substTyVar">substTyVar</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:substTyVars">substTyVars</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</li><li class="src short"><a href="#v:substTyVarBndr">substTyVarBndr</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; (<a href="Type.html#t:TvSubst">TvSubst</a>, <a href="Type.html#t:TyVar">TyVar</a>)</li><li class="src short"><a href="#v:cloneTyVarBndr">cloneTyVarBndr</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Unique.html#t:Unique">Unique</a> -&gt; (<a href="Type.html#t:TvSubst">TvSubst</a>, <a href="Type.html#t:TyVar">TyVar</a>)</li><li class="src short"><a href="#v:deShadowTy">deShadowTy</a> :: <a href="VarSet.html#t:TyVarSet">TyVarSet</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:lookupTyVar">lookupTyVar</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:substKiWith">substKiWith</a> :: [<a href="Var.html#t:KindVar">KindVar</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>] -&gt; <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Type.html#t:Kind">Kind</a></li><li class="src short"><a href="#v:substKisWith">substKisWith</a> :: [<a href="Var.html#t:KindVar">KindVar</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>]</li><li class="src short"><a href="#v:pprType">pprType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprParendType">pprParendType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprTypeApp">pprTypeApp</a> :: <a href="Name.html#t:NamedThing">NamedThing</a> a =&gt; a -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprTyThingCategory">pprTyThingCategory</a> :: <a href="Type.html#t:TyThing">TyThing</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprTyThing">pprTyThing</a> :: <a href="Type.html#t:TyThing">TyThing</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprForAll">pprForAll</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprEqPred">pprEqPred</a> :: <a href="Pair.html#t:Pair">Pair</a> <a href="Type.html#t:Type">Type</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprTheta">pprTheta</a> :: <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprThetaArrowTy">pprThetaArrowTy</a> :: <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprClassPred">pprClassPred</a> :: <a href="Class.html#t:Class">Class</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprKind">pprKind</a> :: <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprParendKind">pprParendKind</a> :: <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:pprSourceTyCon">pprSourceTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></li></ul></div><div id="interface"><h1 id="g:1">Main data types representing Types
</h1><div class="doc"><p><a name="type_classification"></a>
</p><p>Types are one of:
</p><dl><dt>Unboxed</dt><dd>            Iff its representation is other than a pointer
 			Unboxed types are also unlifted.
</dd><dt>Lifted</dt><dd>             Iff it has bottom as an element.
 			Closures always have lifted types: i.e. any
 			let-bound identifier in Core must have a lifted
 			type. Operationally, a lifted object is one that
 			can be entered.
 			Only lifted types may be unified with a type variable.
</dd><dt>Algebraic</dt><dd>          Iff it is a type with one or more constructors, whether
 			declared with <code>data</code> or <code>newtype</code>.
 			An algebraic type is one that can be deconstructed
 			with a case expression. This is <em>not</em> the same as 
			lifted types, because we also include unboxed
 			tuples in this classification.
</dd><dt>Data</dt><dd>               Iff it is a type declared with <code>data</code>, or a boxed tuple.
</dd><dt>Primitive</dt><dd>          Iff it is a built-in type that can't be expressed in Haskell.
</dd></dl><p>Currently, all primitive types are unlifted, but that's not necessarily
 the case: for example, <code>Int</code> could be primitive.
</p><p>Some primitive types are unboxed, such as <code>Int#</code>, whereas some are boxed
 but unlifted (such as <code>ByteArray#</code>).  The only primitive types that we
 classify as algebraic are the unboxed tuples.
</p><p>Some examples of type classifications that may make this a bit clearer are:
</p><pre>
 Type         primitive       boxed           lifted          algebraic
 -----------------------------------------------------------------------------
 Int#         Yes             No              No              No
 ByteArray#   Yes             Yes             No              No
 (# a, b #)   Yes             No              No              Yes
 (  a, b  )   No              Yes             Yes             Yes
 [a]          No              Yes             Yes             Yes
</pre></div><div class="doc"><p>A <em>source type</em> is a type that is a separate type as far as the type checker is
 concerned, but which has a more low-level representation as far as Core-to-Core
 passes and the rest of the back end is concerned.
</p><p>You don't normally have to worry about this, as the utility functions in
 this module will automatically convert a source into a representation type
 if they are spotted, to the best of it's abilities. If you don't want this
 to happen, use the equivalent functions from the <a href="TcType.html">TcType</a> module.
</p></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:TyThing" class="def">TyThing</a>  </p><div class="doc"><p>A typecheckable-thing, essentially anything that has a name
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:AnId" class="def">AnId</a> <a href="Var.html#t:Id">Id</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:ADataCon" class="def">ADataCon</a> <a href="DataCon.html#t:DataCon">DataCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:ATyCon" class="def">ATyCon</a> <a href="TyCon.html#t:TyCon">TyCon</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:ACoAxiom" class="def">ACoAxiom</a> <a href="TyCon.html#t:CoAxiom">CoAxiom</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:TyThing" class="caption collapser" onclick="toggleSection('i:TyThing')">Instances</p><div id="section.i:TyThing" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Type.html#t:TyThing">TyThing</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="Type.html#t:TyThing">TyThing</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="Type.html#t:TyThing">TyThing</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Name.html#t:NamedThing">NamedThing</a> <a href="Type.html#t:TyThing">TyThing</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:Type" class="def">Type</a>  </p><div class="doc"><p>The key representation of types within the compiler
</p></div><div class="subs instances"><p id="control.i:Type" class="caption collapser" onclick="toggleSection('i:Type')">Instances</p><div id="section.i:Type" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Data.html#t:Data">Data</a> <a href="Type.html#t:Type">Type</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="Type.html#t:Type">Type</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="Type.html#t:Type">Type</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:KindOrType" class="def">KindOrType</a> = <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:PredType" class="def">PredType</a> = <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>A type of the form <code>p</code> of kind <code>Constraint</code> represents a value whose type is
 the Haskell predicate <code>p</code>, where a predicate is what occurs before 
 the <code>=&gt;</code> in a Haskell type.
</p><p>We use <code><a href="Type.html#t:PredType">PredType</a></code> as documentation to mark those types that we guarantee to have
 this kind.
</p><p>It can be expanded into its representation, but: 
</p><ul><li> The type checker must treat it as opaque
</li><li> The rest of the compiler treats it as transparent
</li></ul><p>Consider these examples:
</p><pre> f :: (Eq a) =&gt; a -&gt; Int
 g :: (?x :: Int -&gt; Int) =&gt; a -&gt; Int
 h :: (r\l) =&gt; {r} =&gt; {l::Int | r}
</pre><p>Here the <code>Eq a</code> and <code>?x :: Int -&gt; Int</code> and <code>rl</code> are all called &quot;predicates&quot;
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ThetaType" class="def">ThetaType</a> = [<a href="Type.html#t:PredType">PredType</a>]</p><div class="doc"><p>A collection of <code><a href="Type.html#t:PredType">PredType</a></code>s
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Var" class="def">Var</a>  </p><div class="doc"><p>Essentially a typed <code><a href="Name.html#t:Name">Name</a></code>, that may also contain some additional information
 about the <code><a href="Type.html#t:Var">Var</a></code> and it's use sites.
</p></div><div class="subs instances"><p id="control.i:Var" class="caption collapser" onclick="toggleSection('i:Var')">Instances</p><div id="section.i:Var" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Type.html#t:Var">Var</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="Type.html#t:Var">Var</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="Type.html#t:Var">Var</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="Type.html#t:Var">Var</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="Type.html#t:Var">Var</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Outputable.html#t:OutputableBndr">OutputableBndr</a> <a href="Type.html#t:Var">Var</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="Type.html#t:Var">Var</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Unique.html#t:Uniquable">Uniquable</a> <a href="Type.html#t:Var">Var</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Name.html#t:NamedThing">NamedThing</a> <a href="Type.html#t:Var">Var</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:TyVar" class="def">TyVar</a> = <a href="Type.html#t:Var">Var</a></p></div><div class="top"><p class="src"><a name="v:isTyVar" class="def">isTyVar</a> :: <a href="Type.html#t:Var">Var</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><h2 id="g:2">Constructing and deconstructing types
</h2><div class="top"><p class="src"><a name="v:mkTyVarTy" class="def">mkTyVarTy</a> :: <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:mkTyVarTys" class="def">mkTyVarTys</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</p></div><div class="top"><p class="src"><a name="v:getTyVar" class="def">getTyVar</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="Type.html#t:TyVar">TyVar</a></p><div class="doc"><p>Attempts to obtain the type variable underlying a <code><a href="Type.html#t:Type">Type</a></code>, and panics with the
 given message if this is not a type variable type. See also <code><a href="Type.html#v:getTyVar_maybe">getTyVar_maybe</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:getTyVar_maybe" class="def">getTyVar_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="Type.html#t:TyVar">TyVar</a></p><div class="doc"><p>Attempts to obtain the type variable underlying a <code><a href="Type.html#t:Type">Type</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:mkAppTy" class="def">mkAppTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Applies a type to another, as in e.g. <code>k a</code>
</p></div></div><div class="top"><p class="src"><a name="v:mkAppTys" class="def">mkAppTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:splitAppTy" class="def">splitAppTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Attempts to take a type application apart, as in <code><a href="Type.html#v:splitAppTy_maybe">splitAppTy_maybe</a></code>,
 and panics if this is not possible
</p></div></div><div class="top"><p class="src"><a name="v:splitAppTys" class="def">splitAppTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; (<a href="Type.html#t:Type">Type</a>, [<a href="Type.html#t:Type">Type</a>])</p><div class="doc"><p>Recursively splits a type as far as is possible, leaving a residual
 type being applied to and the type arguments applied to it. Never fails,
 even if that means returning an empty list of type applications.
</p></div></div><div class="top"><p class="src"><a name="v:splitAppTy_maybe" class="def">splitAppTy_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="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Attempt to take a type application apart, whether it is a
 function, type constructor, or plain type application. Note
 that type family applications are NEVER unsaturated by this!
</p></div></div><div class="top"><p class="src"><a name="v:repSplitAppTy_maybe" class="def">repSplitAppTy_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="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Does the AppTy split as in <code><a href="Type.html#v:splitAppTy_maybe">splitAppTy_maybe</a></code>, but assumes that 
 any Core view stuff is already done
</p></div></div><div class="top"><p class="src"><a name="v:mkFunTy" class="def">mkFunTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Creates a function type from the given argument and result type
</p></div></div><div class="top"><p class="src"><a name="v:mkFunTys" class="def">mkFunTys</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:splitFunTy" class="def">splitFunTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Attempts to extract the argument and result types from a type, and
 panics if that is not possible. See also <code><a href="Type.html#v:splitFunTy_maybe">splitFunTy_maybe</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:splitFunTy_maybe" class="def">splitFunTy_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="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Attempts to extract the argument and result types from a type
</p></div></div><div class="top"><p class="src"><a name="v:splitFunTys" class="def">splitFunTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; ([<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</p></div><div class="top"><p class="src"><a name="v:splitFunTysN" class="def">splitFunTysN</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; ([<a href="Type.html#t:Type">Type</a>], <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Split off exactly the given number argument types, and panics if that is not possible
</p></div></div><div class="top"><p class="src"><a name="v:funResultTy" class="def">funResultTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Extract the function result type and panic if that is not possible
</p></div></div><div class="top"><p class="src"><a name="v:funArgTy" class="def">funArgTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Extract the function argument type and panic if that is not possible
</p></div></div><div class="top"><p class="src"><a name="v:zipFunTys" class="def">zipFunTys</a> :: <a href="Outputable.html#t:Outputable">Outputable</a> a =&gt; [a] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; ([(a, <a href="Type.html#t:Type">Type</a>)], <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Splits off argument types from the given type and associating
 them with the things in the input list from left to right. The
 final result type is returned, along with the resulting pairs of
 objects and types, albeit with the list of pairs in reverse order.
 Panics if there are not enough argument types for the input list.
</p></div></div><div class="top"><p class="src"><a name="v:mkTyConApp" class="def">mkTyConApp</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>A key function: builds a <code>TyConApp</code> or <code>FunTy</code> as apppropriate to its arguments.
 Applies its arguments to the constructor from left to right
</p></div></div><div class="top"><p class="src"><a name="v:mkTyConTy" class="def">mkTyConTy</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Create the plain type constructor type which has been applied to no type arguments at all.
</p></div></div><div class="top"><p class="src"><a name="v:tyConAppTyCon_maybe" class="def">tyConAppTyCon_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></p><div class="doc"><p>The same as <code>fst . splitTyConApp</code>
</p></div></div><div class="top"><p class="src"><a name="v:tyConAppArgs_maybe" class="def">tyConAppArgs_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="Type.html#t:Type">Type</a>]</p><div class="doc"><p>The same as <code>snd . splitTyConApp</code>
</p></div></div><div class="top"><p class="src"><a name="v:tyConAppTyCon" class="def">tyConAppTyCon</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a></p></div><div class="top"><p class="src"><a name="v:tyConAppArgs" class="def">tyConAppArgs</a> :: <a href="Type.html#t:Type">Type</a> -&gt; [<a href="Type.html#t:Type">Type</a>]</p></div><div class="top"><p class="src"><a name="v:splitTyConApp_maybe" class="def">splitTyConApp_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>])</p><div class="doc"><p>Attempts to tease a type apart into a type constructor and the application
 of a number of arguments to that constructor
</p></div></div><div class="top"><p class="src"><a name="v:splitTyConApp" class="def">splitTyConApp</a> :: <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>])</p><div class="doc"><p>Attempts to tease a type apart into a type constructor and the application
 of a number of arguments to that constructor. Panics if that is not possible.
 See also <code><a href="Type.html#v:splitTyConApp_maybe">splitTyConApp_maybe</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:tyConAppArgN" class="def">tyConAppArgN</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:mkForAllTy" class="def">mkForAllTy</a> :: <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:mkForAllTys" class="def">mkForAllTys</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Wraps foralls over the type using the provided <code><a href="Type.html#t:TyVar">TyVar</a></code>s from left to right
</p></div></div><div class="top"><p class="src"><a name="v:splitForAllTy_maybe" class="def">splitForAllTy_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="Type.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Attempts to take a forall type apart, returning the bound type variable
 and the remainder of the type
</p></div></div><div class="top"><p class="src"><a name="v:splitForAllTys" class="def">splitForAllTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; ([<a href="Type.html#t:TyVar">TyVar</a>], <a href="Type.html#t:Type">Type</a>)</p><div class="doc"><p>Attempts to take a forall type apart, returning all the immediate such bound
 type variables and the remainder of the type. Always suceeds, even if that means
 returning an empty list of <code><a href="Type.html#t:TyVar">TyVar</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:mkPiKinds" class="def">mkPiKinds</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Type.html#t:Kind">Kind</a></p></div><div class="top"><p class="src"><a name="v:mkPiType" class="def">mkPiType</a> :: <a href="Type.html#t:Var">Var</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Makes a <code>(-&gt;)</code> type or a forall type, depending
 on whether it is given a type variable or a term variable.
</p></div></div><div class="top"><p class="src"><a name="v:mkPiTypes" class="def">mkPiTypes</a> :: [<a href="Type.html#t:Var">Var</a>] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p><code><a href="Type.html#v:mkPiType">mkPiType</a></code> for multiple type or value arguments
</p></div></div><div class="top"><p class="src"><a name="v:applyTy" class="def">applyTy</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:KindOrType">KindOrType</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Instantiate a forall type with one or more type arguments.
 Used when we have a polymorphic function applied to type args:
</p><pre> f t1 t2
</pre><p>We use <code>applyTys type-of-f [t1,t2]</code> to compute the type of the expression.
 Panics if no application is possible.
</p></div></div><div class="top"><p class="src"><a name="v:applyTys" class="def">applyTys</a> :: <a href="Type.html#t:Type">Type</a> -&gt; [<a href="Type.html#t:KindOrType">KindOrType</a>] -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>This function is interesting because:
</p><ol><li> The function may have more for-alls than there are args
</li><li> Less obviously, it may have fewer for-alls
</li></ol><p>For case 2. think of:
</p><pre> applyTys (forall a.a) [forall b.b, Int]
</pre><p>This really can happen, but only (I think) in situations involving
 undefined.  For example:
       undefined :: forall a. a
 Term: undefined <code>(forall b. b-&gt;b) </code>Int 
 This term should have type (Int -&gt; Int), but notice that
 there are more type args than foralls in <code><a href="../base-4.5.1.0/Prelude.html#v:undefined">undefined</a></code>s type.
</p></div></div><div class="top"><p class="src"><a name="v:applyTysD" class="def">applyTysD</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:isForAllTy" class="def">isForAllTy</a> :: <a href="Type.html#t:Type">Type</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:dropForAlls" class="def">dropForAlls</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Equivalent to <code>snd . splitForAllTys</code>
</p></div></div><div class="top"><p class="src"><a name="v:newTyConInstRhs" class="def">newTyConInstRhs</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Unwrap one <code>layer</code> of newtype on a type constructor and its arguments, using an 
 eta-reduced version of the <code>newtype</code> if possible
</p></div></div><div class="top"><p class="src"><a name="v:carefullySplitNewType_maybe" class="def">carefullySplitNewType_maybe</a> :: <a href="NameSet.html#t:NameSet">NameSet</a> -&gt; <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; [<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="NameSet.html#t:NameSet">NameSet</a>, <a href="Type.html#t:Type">Type</a>)</p></div><div class="top"><p class="src"><a name="v:mkFamilyTyConApp" class="def">mkFamilyTyConApp</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Given a family instance TyCon and its arg types, return the
 corresponding family type.  E.g:
</p><pre> data family T a
 data instance T (Maybe b) = MkT b
</pre><p>Where the instance tycon is :RTL, so:
</p><pre> mkFamilyTyConApp :RTL Int  =  T (Maybe Int)
</pre></div></div><div class="top"><p class="src"><a name="v:isDictLikeTy" class="def">isDictLikeTy</a> :: <a href="Type.html#t:Type">Type</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:mkEqPred" class="def">mkEqPred</a> :: (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>) -&gt; <a href="Type.html#t:PredType">PredType</a></p><div class="doc"><p>Creates a type equality predicate
</p></div></div><div class="top"><p class="src"><a name="v:mkClassPred" class="def">mkClassPred</a> :: <a href="Class.html#t:Class">Class</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:PredType">PredType</a></p></div><div class="top"><p class="src"><a name="v:mkIPPred" class="def">mkIPPred</a> :: <a href="BasicTypes.html#t:IPName">IPName</a> <a href="Name.html#t:Name">Name</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:PredType">PredType</a></p></div><div class="top"><p class="src"><a name="v:noParenPred" class="def">noParenPred</a> :: <a href="Type.html#t:PredType">PredType</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:isClassPred" class="def">isClassPred</a> :: <a href="Type.html#t:PredType">PredType</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:isEqPred" class="def">isEqPred</a> :: <a href="Type.html#t:PredType">PredType</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:isIPPred" class="def">isIPPred</a> :: <a href="Type.html#t:PredType">PredType</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:mkPrimEqType" class="def">mkPrimEqType</a> :: (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>) -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:PredTree" class="def">PredTree</a>  </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ClassPred" class="def">ClassPred</a> <a href="Class.html#t:Class">Class</a> [<a href="Type.html#t:Type">Type</a>]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:EqPred" class="def">EqPred</a> <a href="Type.html#t:Type">Type</a> <a href="Type.html#t:Type">Type</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:IPPred" class="def">IPPred</a> (<a href="BasicTypes.html#t:IPName">IPName</a> <a href="Name.html#t:Name">Name</a>) <a href="Type.html#t:Type">Type</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:TuplePred" class="def">TuplePred</a> [<a href="Type.html#t:PredType">PredType</a>]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:IrredPred" class="def">IrredPred</a> <a href="Type.html#t:PredType">PredType</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><a name="v:predTreePredType" class="def">predTreePredType</a> :: <a href="Type.html#t:PredTree">PredTree</a> -&gt; <a href="Type.html#t:PredType">PredType</a></p></div><div class="top"><p class="src"><a name="v:classifyPredType" class="def">classifyPredType</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredTree">PredTree</a></p></div><div class="top"><p class="src"><a name="v:getClassPredTys" class="def">getClassPredTys</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; (<a href="Class.html#t:Class">Class</a>, [<a href="Type.html#t:Type">Type</a>])</p></div><div class="top"><p class="src"><a name="v:getClassPredTys_maybe" class="def">getClassPredTys_maybe</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Class.html#t:Class">Class</a>, [<a href="Type.html#t:Type">Type</a>])</p></div><div class="top"><p class="src"><a name="v:getEqPredTys" class="def">getEqPredTys</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p></div><div class="top"><p class="src"><a name="v:getEqPredTys_maybe" class="def">getEqPredTys_maybe</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Type.html#t:Type">Type</a>, <a href="Type.html#t:Type">Type</a>)</p></div><div class="top"><p class="src"><a name="v:getIPPredTy_maybe" class="def">getIPPredTy_maybe</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="BasicTypes.html#t:IPName">IPName</a> <a href="Name.html#t:Name">Name</a>, <a href="Type.html#t:Type">Type</a>)</p></div><h2 id="g:3">Common type constructors
</h2><div class="top"><p class="src"><a name="v:funTyCon" class="def">funTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p></div><h2 id="g:4">Predicates on types
</h2><div class="top"><p class="src"><a name="v:isTyVarTy" class="def">isTyVarTy</a> :: <a href="Type.html#t:Type">Type</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:isFunTy" class="def">isFunTy</a> :: <a href="Type.html#t:Type">Type</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:isDictTy" class="def">isDictTy</a> :: <a href="Type.html#t:Type">Type</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:isPredTy" class="def">isPredTy</a> :: <a href="Type.html#t:Type">Type</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:isKindTy" class="def">isKindTy</a> :: <a href="Type.html#t:Type">Type</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:isUnLiftedType" class="def">isUnLiftedType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>See <a href="Type.html#type_classification">Type</a> for what an unlifted type is
</p></div></div><div class="top"><p class="src"><a name="v:isUnboxedTupleType" class="def">isUnboxedTupleType</a> :: <a href="Type.html#t:Type">Type</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:isAlgType" class="def">isAlgType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>See <a href="Type.html#type_classification">Type</a> for what an algebraic type is.
 Should only be applied to <em>types</em>, as opposed to e.g. partially
 saturated type constructors
</p></div></div><div class="top"><p class="src"><a name="v:isClosedAlgType" class="def">isClosedAlgType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>See <a href="Type.html#type_classification">Type</a> for what an algebraic type is.
 Should only be applied to <em>types</em>, as opposed to e.g. partially
 saturated type constructors. Closed type constructors are those
 with a fixed right hand side, as opposed to e.g. associated types
</p></div></div><div class="top"><p class="src"><a name="v:isPrimitiveType" class="def">isPrimitiveType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Returns true of types that are opaque to Haskell.
 Most of these are unlifted, but now that we interact with .NET, we
 may have primtive (foreign-imported) types that are lifted
</p></div></div><div class="top"><p class="src"><a name="v:isStrictType" class="def">isStrictType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Computes whether an argument (or let right hand side) should
 be computed strictly or lazily, based only on its type.
 Works just like <code><a href="Type.html#v:isUnLiftedType">isUnLiftedType</a></code>, except that it has a special case 
 for dictionaries (i.e. does not work purely on representation types)
</p></div></div><h1 id="g:5">Main data types representing Kinds
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Kind" class="def">Kind</a> = <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>The key type representing kinds in the compiler.
 Invariant: a kind is always in one of these forms:
</p><pre> FunTy k1 k2
 TyConApp PrimTyCon [...]
 TyVar kv   -- (during inference only)
 ForAll ... -- (for top-level coercions)
</pre></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SimpleKind" class="def">SimpleKind</a> = <a href="Type.html#t:Kind">Kind</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:MetaKindVar" class="def">MetaKindVar</a> = <a href="Type.html#t:TyVar">TyVar</a></p></div><h2 id="g:6">Finding the kind of a type
</h2><div class="top"><p class="src"><a name="v:typeKind" class="def">typeKind</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Kind">Kind</a></p></div><h2 id="g:7">Common Kinds and SuperKinds
</h2><div class="top"><p class="src"><a name="v:anyKind" class="def">anyKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:liftedTypeKind" class="def">liftedTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:unliftedTypeKind" class="def">unliftedTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:openTypeKind" class="def">openTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:argTypeKind" class="def">argTypeKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:ubxTupleKind" class="def">ubxTupleKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:constraintKind" class="def">constraintKind</a> :: <a href="Type.html#t:Kind">Kind</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between these <code><a href="Type.html#t:Kind">Kind</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:tySuperKind" class="def">tySuperKind</a> :: SuperKind</p></div><h2 id="g:8">Common Kind type constructors
</h2><div class="top"><p class="src"><a name="v:liftedTypeKindTyCon" class="def">liftedTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:openTypeKindTyCon" class="def">openTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:unliftedTypeKindTyCon" class="def">unliftedTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:argTypeKindTyCon" class="def">argTypeKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:ubxTupleKindTyCon" class="def">ubxTupleKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:constraintKindTyCon" class="def">constraintKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:anyKindTyCon" class="def">anyKindTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a></p><div class="doc"><p>See <a href="Type.html#kind_subtyping">Type</a> for details of the distinction between the <code><a href="Type.html#t:Kind">Kind</a></code> <code><a href="TyCon.html#t:TyCon">TyCon</a></code>s
</p></div></div><h1 id="g:9">Type free variables
</h1><div class="top"><p class="src"><a name="v:tyVarsOfType" class="def">tyVarsOfType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="VarSet.html#t:VarSet">VarSet</a></p><div class="doc"><p>NB: for type synonyms tyVarsOfType does <em>not</em> expand the synonym
 tyVarsOfType returns only the free *type* variables of a type
 For example, tyVarsOfType (a::k) returns {a}, not including the
 kind variable {k}
</p></div></div><div class="top"><p class="src"><a name="v:tyVarsOfTypes" class="def">tyVarsOfTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="VarSet.html#t:TyVarSet">TyVarSet</a></p></div><div class="top"><p class="src"><a name="v:expandTypeSynonyms" class="def">expandTypeSynonyms</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Expand out all type synonyms.  Actually, it'd suffice to expand out
 just the ones that discard type variables (e.g.  type Funny a = Int)
 But we don't know which those are currently, so we just expand all.
</p></div></div><div class="top"><p class="src"><a name="v:typeSize" class="def">typeSize</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a></p></div><div class="top"><p class="src"><a name="v:varSetElemsKvsFirst" class="def">varSetElemsKvsFirst</a> :: <a href="VarSet.html#t:VarSet">VarSet</a> -&gt; [<a href="Type.html#t:TyVar">TyVar</a>]</p></div><div class="top"><p class="src"><a name="v:sortQuantVars" class="def">sortQuantVars</a> :: [<a href="Type.html#t:Var">Var</a>] -&gt; [<a href="Type.html#t:Var">Var</a>]</p></div><h1 id="g:10">Type comparison
</h1><div class="top"><p class="src"><a name="v:eqType" class="def">eqType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Type equality on source types. Does not look through <code>newtypes</code> or 
 <code><a href="Type.html#t:PredType">PredType</a></code>s, but it does look through type synonyms.
</p></div></div><div class="top"><p class="src"><a name="v:eqTypeX" class="def">eqTypeX</a> :: <a href="VarEnv.html#t:RnEnv2">RnEnv2</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</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:eqTypes" class="def">eqTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</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:cmpType" class="def">cmpType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></p></div><div class="top"><p class="src"><a name="v:cmpTypes" class="def">cmpTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></p></div><div class="top"><p class="src"><a name="v:eqPred" class="def">eqPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredType">PredType</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:eqPredX" class="def">eqPredX</a> :: <a href="VarEnv.html#t:RnEnv2">RnEnv2</a> -&gt; <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredType">PredType</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:cmpPred" class="def">cmpPred</a> :: <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="Type.html#t:PredType">PredType</a> -&gt; <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></p></div><div class="top"><p class="src"><a name="v:eqKind" class="def">eqKind</a> :: <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><h1 id="g:11">Forcing evaluation of types
</h1><div class="top"><p class="src"><a name="v:seqType" class="def">seqType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; ()</p></div><div class="top"><p class="src"><a name="v:seqTypes" class="def">seqTypes</a> :: [<a href="Type.html#t:Type">Type</a>] -&gt; ()</p></div><h1 id="g:12">Other views onto Types
</h1><div class="top"><p class="src"><a name="v:coreView" class="def">coreView</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="Type.html#t:Type">Type</a></p><div class="doc"><p>In Core, we &quot;look through&quot; non-recursive newtypes and <code>PredTypes</code>: this
 function tries to obtain a different view of the supplied type given this
</p><p>Strips off the <em>top layer only</em> of a type to give 
 its underlying representation type. 
 Returns Nothing if there is nothing to look through.
</p><p>By being non-recursive and inlined, this case analysis gets efficiently
 joined onto the case analysis that the caller is already doing
</p></div></div><div class="top"><p class="src"><a name="v:tcView" class="def">tcView</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="Type.html#t:Type">Type</a></p><div class="doc"><p>Similar to <code><a href="Type.html#v:coreView">coreView</a></code>, but for the type checker, which just looks through synonyms
</p></div></div><div class="top"><p class="src"><a name="v:repType" class="def">repType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Looks through:
</p><ol><li> For-alls
	2. Synonyms
	3. Predicates
	4. All newtypes, including recursive ones, but not newtype families
</li></ol><p>It's useful in the back end of the compiler.
</p></div></div><div class="top"><p class="src"><a name="v:deepRepType" class="def">deepRepType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><h1 id="g:13">Type representation for the code generator
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:PrimRep" class="def">PrimRep</a>  </p><div class="doc"><p>A <code><a href="Type.html#t:PrimRep">PrimRep</a></code> is an abstraction of a type.  It contains information that
 the code generator needs in order to pass arguments, return results,
 and store values of this type.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:VoidRep" class="def">VoidRep</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:PtrRep" class="def">PtrRep</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:IntRep" class="def">IntRep</a></td><td class="doc"><p>Signed, word-sized value
</p></td></tr><tr><td class="src"><a name="v:WordRep" class="def">WordRep</a></td><td class="doc"><p>Unsigned, word-sized value
</p></td></tr><tr><td class="src"><a name="v:Int64Rep" class="def">Int64Rep</a></td><td class="doc"><p>Signed, 64 bit value (with 32-bit words only)
</p></td></tr><tr><td class="src"><a name="v:Word64Rep" class="def">Word64Rep</a></td><td class="doc"><p>Unsigned, 64 bit value (with 32-bit words only)
</p></td></tr><tr><td class="src"><a name="v:AddrRep" class="def">AddrRep</a></td><td class="doc"><p>A pointer, but <em>not</em> to a Haskell value (use <code><a href="Type.html#v:PtrRep">PtrRep</a></code>)
</p></td></tr><tr><td class="src"><a name="v:FloatRep" class="def">FloatRep</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:DoubleRep" class="def">DoubleRep</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:PrimRep" class="caption collapser" onclick="toggleSection('i:PrimRep')">Instances</p><div id="section.i:PrimRep" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Type.html#t:PrimRep">PrimRep</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="Type.html#t:PrimRep">PrimRep</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="Type.html#t:PrimRep">PrimRep</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:typePrimRep" class="def">typePrimRep</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:PrimRep">PrimRep</a></p><div class="doc"><p>Discovers the primitive representation of a more abstract <code><a href="Type.html#t:Type">Type</a></code>
 Only applied to types of values
</p></div></div><h1 id="g:14">Main type substitution data types
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:TvSubstEnv" class="def">TvSubstEnv</a> = <a href="VarEnv.html#t:TyVarEnv">TyVarEnv</a> <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>A substitition of <code><a href="Type.html#t:Type">Type</a></code>s for <code><a href="Type.html#t:TyVar">TyVar</a></code>s
                 and <code><a href="Type.html#t:Kind">Kind</a></code>s for <code><a href="Var.html#t:KindVar">KindVar</a></code>s
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:TvSubst" class="def">TvSubst</a>  </p><div class="doc"><p>Type substitution
</p><p><a name="tvsubst_invariant"></a>
 The following invariants must hold of a <code><a href="Type.html#t:TvSubst">TvSubst</a></code>:
</p><ol><li> The in-scope set is needed <em>only</em> to
 guide the generation of fresh uniques
</li><li> In particular, the <em>kind</em> of the type variables in 
 the in-scope set is not relevant
</li><li> The substition is only applied ONCE! This is because
 in general such application will not reached a fixed point.
</li></ol></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TvSubst" class="def">TvSubst</a> <a href="VarEnv.html#t:InScopeSet">InScopeSet</a> <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:TvSubst" class="caption collapser" onclick="toggleSection('i:TvSubst')">Instances</p><div id="section.i:TvSubst" class="show"><table><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="Type.html#t:TvSubst">TvSubst</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h2 id="g:15">Manipulating type substitutions
</h2><div class="top"><p class="src"><a name="v:emptyTvSubstEnv" class="def">emptyTvSubstEnv</a> :: <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></p></div><div class="top"><p class="src"><a name="v:emptyTvSubst" class="def">emptyTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:mkTvSubst" class="def">mkTvSubst</a> :: <a href="VarEnv.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:mkOpenTvSubst" class="def">mkOpenTvSubst</a> :: <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p><div class="doc"><p>Generates the in-scope set for the <code><a href="Type.html#t:TvSubst">TvSubst</a></code> from the types in the incoming
 environment, hence <a href="open.html">open</a>
</p></div></div><div class="top"><p class="src"><a name="v:zipOpenTvSubst" class="def">zipOpenTvSubst</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p><div class="doc"><p>Generates the in-scope set for the <code><a href="Type.html#t:TvSubst">TvSubst</a></code> from the types in the incoming
 environment, hence <a href="open.html">open</a>
</p></div></div><div class="top"><p class="src"><a name="v:zipTopTvSubst" class="def">zipTopTvSubst</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:mkTopTvSubst" class="def">mkTopTvSubst</a> :: [(<a href="Type.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p><div class="doc"><p>Called when doing top-level substitutions. Here we expect that the 
 free vars of the range of the substitution will be empty.
</p></div></div><div class="top"><p class="src"><a name="v:notElemTvSubst" class="def">notElemTvSubst</a> :: <a href="Var.html#t:CoVar">CoVar</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</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:getTvSubstEnv" class="def">getTvSubstEnv</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></p></div><div class="top"><p class="src"><a name="v:setTvSubstEnv" class="def">setTvSubstEnv</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:zapTvSubstEnv" class="def">zapTvSubstEnv</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:getTvInScope" class="def">getTvInScope</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="VarEnv.html#t:InScopeSet">InScopeSet</a></p></div><div class="top"><p class="src"><a name="v:extendTvInScope" class="def">extendTvInScope</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:Var">Var</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:extendTvInScopeList" class="def">extendTvInScopeList</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:Var">Var</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:extendTvSubst" class="def">extendTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:extendTvSubstList" class="def">extendTvSubstList</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><div class="top"><p class="src"><a name="v:isInScope" class="def">isInScope</a> :: <a href="Type.html#t:Var">Var</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</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:composeTvSubst" class="def">composeTvSubst</a> :: <a href="VarEnv.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></p><div class="doc"><p><code>(compose env1 env2)(x)</code> is <code>env1(env2(x))</code>; i.e. apply <code>env2</code> then <code>env1</code>.
 It assumes that both are idempotent.
 Typically, <code>env1</code> is the refinement to a base substitution <code>env2</code>
</p></div></div><div class="top"><p class="src"><a name="v:zipTyEnv" class="def">zipTyEnv</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:TvSubstEnv">TvSubstEnv</a></p></div><div class="top"><p class="src"><a name="v:isEmptyTvSubst" class="def">isEmptyTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</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:unionTvSubst" class="def">unionTvSubst</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TvSubst">TvSubst</a></p></div><h2 id="g:16">Performing substitution on types and kinds
</h2><div class="top"><p class="src"><a name="v:substTy" class="def">substTy</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Substitute within a <code><a href="Type.html#t:Type">Type</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substTys" class="def">substTys</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</p><div class="doc"><p>Substitute within several <code><a href="Type.html#t:Type">Type</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:substTyWith" class="def">substTyWith</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Type substitution making use of an <code><a href="Type.html#t:TvSubst">TvSubst</a></code> that
 is assumed to be open, see <code><a href="Type.html#v:zipOpenTvSubst">zipOpenTvSubst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substTysWith" class="def">substTysWith</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</p><div class="doc"><p>Type substitution making use of an <code><a href="Type.html#t:TvSubst">TvSubst</a></code> that
 is assumed to be open, see <code><a href="Type.html#v:zipOpenTvSubst">zipOpenTvSubst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substTheta" class="def">substTheta</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="Type.html#t:ThetaType">ThetaType</a></p><div class="doc"><p>Substitute within a <code><a href="Type.html#t:ThetaType">ThetaType</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substTyVar" class="def">substTyVar</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:substTyVars" class="def">substTyVars</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; [<a href="Type.html#t:Type">Type</a>]</p></div><div class="top"><p class="src"><a name="v:substTyVarBndr" class="def">substTyVarBndr</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; (<a href="Type.html#t:TvSubst">TvSubst</a>, <a href="Type.html#t:TyVar">TyVar</a>)</p></div><div class="top"><p class="src"><a name="v:cloneTyVarBndr" class="def">cloneTyVarBndr</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="Unique.html#t:Unique">Unique</a> -&gt; (<a href="Type.html#t:TvSubst">TvSubst</a>, <a href="Type.html#t:TyVar">TyVar</a>)</p></div><div class="top"><p class="src"><a name="v:deShadowTy" class="def">deShadowTy</a> :: <a href="VarSet.html#t:TyVarSet">TyVarSet</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Remove any nested binders mentioning the <code><a href="Type.html#t:TyVar">TyVar</a></code>s in the <code><a href="VarSet.html#t:TyVarSet">TyVarSet</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:lookupTyVar" class="def">lookupTyVar</a> :: <a href="Type.html#t:TvSubst">TvSubst</a> -&gt; <a href="Type.html#t:TyVar">TyVar</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Type.html#t:Type">Type</a></p></div><div class="top"><p class="src"><a name="v:substKiWith" class="def">substKiWith</a> :: [<a href="Var.html#t:KindVar">KindVar</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>] -&gt; <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Type.html#t:Kind">Kind</a></p></div><div class="top"><p class="src"><a name="v:substKisWith" class="def">substKisWith</a> :: [<a href="Var.html#t:KindVar">KindVar</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>] -&gt; [<a href="Type.html#t:Kind">Kind</a>]</p></div><h1 id="g:17">Pretty-printing
</h1><div class="top"><p class="src"><a name="v:pprType" class="def">pprType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprParendType" class="def">pprParendType</a> :: <a href="Type.html#t:Type">Type</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprTypeApp" class="def">pprTypeApp</a> :: <a href="Name.html#t:NamedThing">NamedThing</a> a =&gt; a -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprTyThingCategory" class="def">pprTyThingCategory</a> :: <a href="Type.html#t:TyThing">TyThing</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprTyThing" class="def">pprTyThing</a> :: <a href="Type.html#t:TyThing">TyThing</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprForAll" class="def">pprForAll</a> :: [<a href="Type.html#t:TyVar">TyVar</a>] -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprEqPred" class="def">pprEqPred</a> :: <a href="Pair.html#t:Pair">Pair</a> <a href="Type.html#t:Type">Type</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprTheta" class="def">pprTheta</a> :: <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprThetaArrowTy" class="def">pprThetaArrowTy</a> :: <a href="Type.html#t:ThetaType">ThetaType</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprClassPred" class="def">pprClassPred</a> :: <a href="Class.html#t:Class">Class</a> -&gt; [<a href="Type.html#t:Type">Type</a>] -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprKind" class="def">pprKind</a> :: <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprParendKind" class="def">pprParendKind</a> :: <a href="Type.html#t:Kind">Kind</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:pprSourceTyCon" class="def">pprSourceTyCon</a> :: <a href="TyCon.html#t:TyCon">TyCon</a> -&gt; <a href="Outputable.html#t:SDoc">SDoc</a></p><div class="doc"><p>Pretty prints a <code><a href="TyCon.html#t:TyCon">TyCon</a></code>, using the family instance in case of a
 representation tycon.  For example:
</p><pre> data T [a] = ...
</pre><p>In that case we want to print <code>T [a]</code>, where <code>T</code> is the family <code><a href="TyCon.html#t:TyCon">TyCon</a></code>
</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>