Sophie

Sophie

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

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>CoreSubst</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_CoreSubst.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">CoreSubst</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Main data types
</a><ul><li><a href="#g:2">Substituting into expressions and related types
</a></li><li><a href="#g:3">Operations on substitutions
</a></li><li><a href="#g:4">Substituting and cloning binders
</a></li><li><a href="#g:5">Simple expression optimiser
</a></li></ul></li></ul></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:Subst">Subst</a>  = <a href="#v:Subst">Subst</a> <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> <a href="CoreSubst.html#t:IdSubstEnv">IdSubstEnv</a> <a href="CoreSubst.html#t:TvSubstEnv">TvSubstEnv</a> <a href="Coercion.html#t:CvSubstEnv">CvSubstEnv</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">type</span> <a href="#t:IdSubstEnv">IdSubstEnv</a> = <a href="VarEnv.html#t:IdEnv">IdEnv</a> <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:InScopeSet">InScopeSet</a> </li><li class="src short"><a href="#v:deShadowBinds">deShadowBinds</a> :: <a href="CoreSyn.html#t:CoreProgram">CoreProgram</a> -&gt; <a href="CoreSyn.html#t:CoreProgram">CoreProgram</a></li><li class="src short"><a href="#v:substSpec">substSpec</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="IdInfo.html#t:SpecInfo">SpecInfo</a> -&gt; <a href="IdInfo.html#t:SpecInfo">SpecInfo</a></li><li class="src short"><a href="#v:substRulesForImportedIds">substRulesForImportedIds</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>] -&gt; [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>]</li><li class="src short"><a href="#v:substTy">substTy</a> :: <a href="CoreSubst.html#t:Subst">Subst</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:substCo">substCo</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a></li><li class="src short"><a href="#v:substExpr">substExpr</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></li><li class="src short"><a href="#v:substExprSC">substExprSC</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></li><li class="src short"><a href="#v:substBind">substBind</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreBind">CoreBind</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="CoreSyn.html#t:CoreBind">CoreBind</a>)</li><li class="src short"><a href="#v:substBindSC">substBindSC</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreBind">CoreBind</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="CoreSyn.html#t:CoreBind">CoreBind</a>)</li><li class="src short"><a href="#v:substUnfolding">substUnfolding</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a></li><li class="src short"><a href="#v:substUnfoldingSC">substUnfoldingSC</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a></li><li class="src short"><a href="#v:substUnfoldingSource">substUnfoldingSource</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:UnfoldingSource">UnfoldingSource</a> -&gt; <a href="CoreSyn.html#t:UnfoldingSource">UnfoldingSource</a></li><li class="src short"><a href="#v:lookupIdSubst">lookupIdSubst</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></li><li class="src short"><a href="#v:lookupTvSubst">lookupTvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a></li><li class="src short"><a href="#v:lookupCvSubst">lookupCvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:CoVar">CoVar</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a></li><li class="src short"><a href="#v:substIdOcc">substIdOcc</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="Var.html#t:Id">Id</a></li><li class="src short"><a href="#v:substTickish">substTickish</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:Tickish">Tickish</a> <a href="Var.html#t:Id">Id</a> -&gt; <a href="CoreSyn.html#t:Tickish">Tickish</a> <a href="Var.html#t:Id">Id</a></li><li class="src short"><a href="#v:emptySubst">emptySubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:mkEmptySubst">mkEmptySubst</a> :: <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:mkSubst">mkSubst</a> :: <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="CoreSubst.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Coercion.html#t:CvSubstEnv">CvSubstEnv</a> -&gt; <a href="CoreSubst.html#t:IdSubstEnv">IdSubstEnv</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:mkOpenSubst">mkOpenSubst</a> :: <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; [(<a href="Var.html#t:Var">Var</a>, <a href="CoreSyn.html#t:CoreArg">CoreArg</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:substInScope">substInScope</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a></li><li class="src short"><a href="#v:isEmptySubst">isEmptySubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:extendIdSubst">extendIdSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendIdSubstList">extendIdSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:Id">Id</a>, <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendTvSubst">extendTvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendTvSubstList">extendTvSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendCvSubst">extendCvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:CoVar">CoVar</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendCvSubstList">extendCvSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:CoVar">CoVar</a>, <a href="Coercion.html#t:Coercion">Coercion</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendSubst">extendSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSyn.html#t:CoreArg">CoreArg</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendSubstList">extendSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:Var">Var</a>, <a href="CoreSyn.html#t:CoreArg">CoreArg</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendSubstWithVar">extendSubstWithVar</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:zapSubstEnv">zapSubstEnv</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:addInScopeSet">addInScopeSet</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="VarSet.html#t:VarSet">VarSet</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendInScope">extendInScope</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendInScopeList">extendInScopeList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:extendInScopeIds">extendInScopeIds</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:isInScope">isInScope</a> :: <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:setInScope">setInScope</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:delBndr">delBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:delBndrs">delBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></li><li class="src short"><a href="#v:substBndr">substBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="Var.html#t:Var">Var</a>)</li><li class="src short"><a href="#v:substBndrs">substBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Var">Var</a>])</li><li class="src short"><a href="#v:substRecBndrs">substRecBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Id">Id</a>])</li><li class="src short"><a href="#v:cloneBndr">cloneBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Unique.html#t:Unique">Unique</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="Var.html#t:Var">Var</a>)</li><li class="src short"><a href="#v:cloneBndrs">cloneBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Var">Var</a>])</li><li class="src short"><a href="#v:cloneIdBndr">cloneIdBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="Var.html#t:Id">Id</a>)</li><li class="src short"><a href="#v:cloneIdBndrs">cloneIdBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Id">Id</a>])</li><li class="src short"><a href="#v:cloneRecIdBndrs">cloneRecIdBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Id">Id</a>])</li><li class="src short"><a href="#v:simpleOptPgm">simpleOptPgm</a> :: <a href="DynFlags.html#t:DynFlags">DynFlags</a> -&gt; <a href="Module.html#t:Module">Module</a> -&gt; <a href="CoreSyn.html#t:CoreProgram">CoreProgram</a> -&gt; [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>] -&gt; [<a href="CoreSyn.html#t:CoreVect">CoreVect</a>] -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="CoreSyn.html#t:CoreProgram">CoreProgram</a>, [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>], [<a href="CoreSyn.html#t:CoreVect">CoreVect</a>])</li><li class="src short"><a href="#v:simpleOptExpr">simpleOptExpr</a> :: <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></li><li class="src short"><a href="#v:simpleOptExprWith">simpleOptExprWith</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; InExpr -&gt; OutExpr</li><li class="src short"><a href="#v:exprIsConApp_maybe">exprIsConApp_maybe</a> :: <a href="CoreSyn.html#t:IdUnfoldingFun">IdUnfoldingFun</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>], [<a href="CoreSyn.html#t:CoreExpr">CoreExpr</a>])</li><li class="src short"><a href="#v:exprIsLiteral_maybe">exprIsLiteral_maybe</a> :: <a href="CoreSyn.html#t:IdUnfoldingFun">IdUnfoldingFun</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Literal.html#t:Literal">Literal</a></li></ul></div><div id="interface"><h1 id="g:1">Main data types
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Subst" class="def">Subst</a>  </p><div class="doc"><p>A substitution environment, containing both <code><a href="Var.html#t:Id">Id</a></code> and <code><a href="Var.html#t:TyVar">TyVar</a></code> substitutions.
</p><p>Some invariants apply to how you use the substitution:
</p><ol><li> <a name="in_scope_invariant"></a> The in-scope set contains at least those <code><a href="Var.html#t:Id">Id</a></code>s and <code><a href="Var.html#t:TyVar">TyVar</a></code>s that will be in scope <em>after</em>
 applying the substitution to a term. Precisely, the in-scope set must be a superset of the free vars of the
 substitution range that might possibly clash with locally-bound variables in the thing being substituted in.
</li><li> <a name="apply_once"></a> You may apply the substitution only <em>once</em>
</li></ol><p>There are various ways of setting up the in-scope set such that the first of these invariants hold:
</p><ul><li> Arrange that the in-scope set really is all the things in scope
</li><li> Arrange that it's the free vars of the range of the substitution
</li><li> Make it empty, if you know that all the free vars of the substitution are fresh, and hence can't possibly clash
</li></ul></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Subst" class="def">Subst</a> <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> <a href="CoreSubst.html#t:IdSubstEnv">IdSubstEnv</a> <a href="CoreSubst.html#t:TvSubstEnv">TvSubstEnv</a> <a href="Coercion.html#t:CvSubstEnv">CvSubstEnv</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Subst" class="caption collapser" onclick="toggleSection('i:Subst')">Instances</p><div id="section.i:Subst" class="show"><table><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="CoreSubst.html#t:Subst">Subst</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: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="Var.html#t:TyVar">TyVar</a></code>s
                 and <code><a href="Kind.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">type</span> <a name="t:IdSubstEnv" class="def">IdSubstEnv</a> = <a href="VarEnv.html#t:IdEnv">IdEnv</a> <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></p><div class="doc"><p>An environment for substituting for <code><a href="Var.html#t:Id">Id</a></code>s
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:InScopeSet" class="def">InScopeSet</a>  </p><div class="doc"><p>A set of variables that are in scope at some point
</p></div><div class="subs instances"><p id="control.i:InScopeSet" class="caption collapser" onclick="toggleSection('i:InScopeSet')">Instances</p><div id="section.i:InScopeSet" class="show"><table><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h2 id="g:2">Substituting into expressions and related types
</h2><div class="top"><p class="src"><a name="v:deShadowBinds" class="def">deShadowBinds</a> :: <a href="CoreSyn.html#t:CoreProgram">CoreProgram</a> -&gt; <a href="CoreSyn.html#t:CoreProgram">CoreProgram</a></p><div class="doc"><p>De-shadowing the program is sometimes a useful pre-pass. It can be done simply
 by running over the bindings with an empty substitution, becuase substitution
 returns a result that has no-shadowing guaranteed.
</p><p>(Actually, within a single <em>type</em> there might still be shadowing, because 
 <code><a href="CoreSubst.html#v:substTy">substTy</a></code> is a no-op for the empty substitution, but that's probably OK.)
</p><dl><dt>Aug 09</dt><dd> This function is not used in GHC at the moment, but seems so 
          short and simple that I'm going to leave it here
</dd></dl></div></div><div class="top"><p class="src"><a name="v:substSpec" class="def">substSpec</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="IdInfo.html#t:SpecInfo">SpecInfo</a> -&gt; <a href="IdInfo.html#t:SpecInfo">SpecInfo</a></p><div class="doc"><p>Substitutes for the <code><a href="Var.html#t:Id">Id</a></code>s within the <code>WorkerInfo</code> given the new function <code><a href="Var.html#t:Id">Id</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substRulesForImportedIds" class="def">substRulesForImportedIds</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>] -&gt; [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>]</p></div><div class="top"><p class="src"><a name="v:substTy" class="def">substTy</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>See <code><a href="Type.html#v:substTy">substTy</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substCo" class="def">substCo</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a></p><div class="doc"><p>See <code><a href="Coercion.html#v:substCo">substCo</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substExpr" class="def">substExpr</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></p></div><div class="top"><p class="src"><a name="v:substExprSC" class="def">substExprSC</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></p><div class="doc"><p>Apply a substititon to an entire <code><a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></code>. Rememeber, you may only 
 apply the substitution <em>once</em>: see <a href="CoreSubst.html#apply_once">CoreSubst</a>
</p><p>Do *not* attempt to short-cut in the case of an empty substitution!
 See Note [Extending the Subst]
</p></div></div><div class="top"><p class="src"><a name="v:substBind" class="def">substBind</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreBind">CoreBind</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="CoreSyn.html#t:CoreBind">CoreBind</a>)</p><div class="doc"><p>Apply a substititon to an entire <code><a href="CoreSyn.html#t:CoreBind">CoreBind</a></code>, additionally returning an updated <code><a href="CoreSubst.html#t:Subst">Subst</a></code>
 that should be used by subsequent substitutons.
</p></div></div><div class="top"><p class="src"><a name="v:substBindSC" class="def">substBindSC</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:CoreBind">CoreBind</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="CoreSyn.html#t:CoreBind">CoreBind</a>)</p><div class="doc"><p>Apply a substititon to an entire <code><a href="CoreSyn.html#t:CoreBind">CoreBind</a></code>, additionally returning an updated <code><a href="CoreSubst.html#t:Subst">Subst</a></code>
 that should be used by subsequent substitutons.
</p></div></div><div class="top"><p class="src"><a name="v:substUnfolding" class="def">substUnfolding</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a></p><div class="doc"><p>Substitutes for the <code><a href="Var.html#t:Id">Id</a></code>s within an unfolding
</p></div></div><div class="top"><p class="src"><a name="v:substUnfoldingSC" class="def">substUnfoldingSC</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a> -&gt; <a href="CoreSyn.html#t:Unfolding">Unfolding</a></p><div class="doc"><p>Substitutes for the <code><a href="Var.html#t:Id">Id</a></code>s within an unfolding
</p></div></div><div class="top"><p class="src"><a name="v:substUnfoldingSource" class="def">substUnfoldingSource</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:UnfoldingSource">UnfoldingSource</a> -&gt; <a href="CoreSyn.html#t:UnfoldingSource">UnfoldingSource</a></p></div><div class="top"><p class="src"><a name="v:lookupIdSubst" class="def">lookupIdSubst</a> :: <a href="Outputable.html#t:SDoc">SDoc</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></p><div class="doc"><p>Find the substitution for an <code><a href="Var.html#t:Id">Id</a></code> in the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:lookupTvSubst" class="def">lookupTvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a></p><div class="doc"><p>Find the substitution for a <code><a href="Var.html#t:TyVar">TyVar</a></code> in the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:lookupCvSubst" class="def">lookupCvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:CoVar">CoVar</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a></p><div class="doc"><p>Find the coercion substitution for a <code><a href="Var.html#t:CoVar">CoVar</a></code> in the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:substIdOcc" class="def">substIdOcc</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="Var.html#t:Id">Id</a></p></div><div class="top"><p class="src"><a name="v:substTickish" class="def">substTickish</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSyn.html#t:Tickish">Tickish</a> <a href="Var.html#t:Id">Id</a> -&gt; <a href="CoreSyn.html#t:Tickish">Tickish</a> <a href="Var.html#t:Id">Id</a></p></div><h2 id="g:3">Operations on substitutions
</h2><div class="top"><p class="src"><a name="v:emptySubst" class="def">emptySubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a></p></div><div class="top"><p class="src"><a name="v:mkEmptySubst" class="def">mkEmptySubst</a> :: <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p></div><div class="top"><p class="src"><a name="v:mkSubst" class="def">mkSubst</a> :: <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="CoreSubst.html#t:TvSubstEnv">TvSubstEnv</a> -&gt; <a href="Coercion.html#t:CvSubstEnv">CvSubstEnv</a> -&gt; <a href="CoreSubst.html#t:IdSubstEnv">IdSubstEnv</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p></div><div class="top"><p class="src"><a name="v:mkOpenSubst" class="def">mkOpenSubst</a> :: <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; [(<a href="Var.html#t:Var">Var</a>, <a href="CoreSyn.html#t:CoreArg">CoreArg</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Simultaneously substitute for a bunch of variables
   No left-right shadowing
   ie the substitution for   (x y. e) a1 a2
      so neither x nor y scope over a1 a2
</p></div></div><div class="top"><p class="src"><a name="v:substInScope" class="def">substInScope</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a></p><div class="doc"><p>Find the in-scope set: see <a href="CoreSubst.html#in_scope_invariant">CoreSubst</a>
</p></div></div><div class="top"><p class="src"><a name="v:isEmptySubst" class="def">isEmptySubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</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:extendIdSubst" class="def">extendIdSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add a substitution for an <code><a href="Var.html#t:Id">Id</a></code> to the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>: you must ensure that the in-scope set is
 such that the <a href="CoreSubst.html#in_scope_invariant">CoreSubst</a> is true after extending the substitution like this
</p></div></div><div class="top"><p class="src"><a name="v:extendIdSubstList" class="def">extendIdSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:Id">Id</a>, <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Adds multiple <code><a href="Var.html#t:Id">Id</a></code> substitutions to the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>: see also <code><a href="CoreSubst.html#v:extendIdSubst">extendIdSubst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:extendTvSubst" class="def">extendTvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:TyVar">TyVar</a> -&gt; <a href="Type.html#t:Type">Type</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add a substitution for a <code><a href="Var.html#t:TyVar">TyVar</a></code> to the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>: you must ensure that the in-scope set is
 such that the <a href="CoreSubst.html#in_scope_invariant">CoreSubst</a> is true after extending the substitution like this
</p></div></div><div class="top"><p class="src"><a name="v:extendTvSubstList" class="def">extendTvSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:TyVar">TyVar</a>, <a href="Type.html#t:Type">Type</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Adds multiple <code><a href="Var.html#t:TyVar">TyVar</a></code> substitutions to the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>: see also <code><a href="CoreSubst.html#v:extendTvSubst">extendTvSubst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:extendCvSubst" class="def">extendCvSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:CoVar">CoVar</a> -&gt; <a href="Coercion.html#t:Coercion">Coercion</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add a substitution from a <code><a href="Var.html#t:CoVar">CoVar</a></code> to a <code><a href="Coercion.html#t:Coercion">Coercion</a></code> to the <code><a href="CoreSubst.html#t:Subst">Subst</a></code>: you must ensure that the in-scope set is
 such that the <a href="CoreSubst.html#in_scope_invariant">CoreSubst</a> is true after extending the substitution like this
</p></div></div><div class="top"><p class="src"><a name="v:extendCvSubstList" class="def">extendCvSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:CoVar">CoVar</a>, <a href="Coercion.html#t:Coercion">Coercion</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Adds multiple <code><a href="Var.html#t:CoVar">CoVar</a></code> -&gt; <code><a href="Coercion.html#t:Coercion">Coercion</a></code> substitutions to the
 <code><a href="CoreSubst.html#t:Subst">Subst</a></code>: see also <code><a href="CoreSubst.html#v:extendCvSubst">extendCvSubst</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:extendSubst" class="def">extendSubst</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSyn.html#t:CoreArg">CoreArg</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add a substitution appropriate to the thing being substituted
   (whether an expression, type, or coercion). See also
   <code><a href="CoreSubst.html#v:extendIdSubst">extendIdSubst</a></code>, <code><a href="CoreSubst.html#v:extendTvSubst">extendTvSubst</a></code>, and <code><a href="CoreSubst.html#v:extendCvSubst">extendCvSubst</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:extendSubstList" class="def">extendSubstList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [(<a href="Var.html#t:Var">Var</a>, <a href="CoreSyn.html#t:CoreArg">CoreArg</a>)] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add a substitution as appropriate to each of the terms being
   substituted (whether expressions, types, or coercions). See also
   <code><a href="CoreSubst.html#v:extendSubst">extendSubst</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:extendSubstWithVar" class="def">extendSubstWithVar</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p></div><div class="top"><p class="src"><a name="v:zapSubstEnv" class="def">zapSubstEnv</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Remove all substitutions for <code><a href="Var.html#t:Id">Id</a></code>s and <code><a href="Var.html#t:Var">Var</a></code>s that might have been built up
 while preserving the in-scope set
</p></div></div><div class="top"><p class="src"><a name="v:addInScopeSet" class="def">addInScopeSet</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="VarSet.html#t:VarSet">VarSet</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add the <code><a href="Var.html#t:Var">Var</a></code> to the in-scope set, but do not remove
 any existing substitutions for it
</p></div></div><div class="top"><p class="src"><a name="v:extendInScope" class="def">extendInScope</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add the <code><a href="Var.html#t:Var">Var</a></code> to the in-scope set: as a side effect,
 and remove any existing substitutions for it
</p></div></div><div class="top"><p class="src"><a name="v:extendInScopeList" class="def">extendInScopeList</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Add the <code><a href="Var.html#t:Var">Var</a></code>s to the in-scope set: see also <code><a href="CoreSubst.html#v:extendInScope">extendInScope</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:extendInScopeIds" class="def">extendInScopeIds</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p><div class="doc"><p>Optimized version of <code><a href="CoreSubst.html#v:extendInScopeList">extendInScopeList</a></code> that can be used if you are certain 
 all the things being added are <code><a href="Var.html#t:Id">Id</a></code>s and hence none are <code><a href="Var.html#t:TyVar">TyVar</a></code>s or <code><a href="Var.html#t:CoVar">CoVar</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:isInScope" class="def">isInScope</a> :: <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</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:setInScope" class="def">setInScope</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="CoreSubst.html#t:InScopeSet">InScopeSet</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p></div><div class="top"><p class="src"><a name="v:delBndr" class="def">delBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p></div><div class="top"><p class="src"><a name="v:delBndrs" class="def">delBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; <a href="CoreSubst.html#t:Subst">Subst</a></p></div><h2 id="g:4">Substituting and cloning binders
</h2><div class="top"><p class="src"><a name="v:substBndr" class="def">substBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="Var.html#t:Var">Var</a>)</p><div class="doc"><p>Substitutes a <code><a href="Var.html#t:Var">Var</a></code> for another one according to the <code><a href="CoreSubst.html#t:Subst">Subst</a></code> given, returning
 the result and an updated <code><a href="CoreSubst.html#t:Subst">Subst</a></code> that should be used by subsequent substitutons.
 <code><a href="IdInfo.html#t:IdInfo">IdInfo</a></code> is preserved by this process, although it is substituted into appropriately.
</p></div></div><div class="top"><p class="src"><a name="v:substBndrs" class="def">substBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Var">Var</a>])</p><div class="doc"><p>Applies <code><a href="CoreSubst.html#v:substBndr">substBndr</a></code> to a number of <code><a href="Var.html#t:Var">Var</a></code>s, accumulating a new <code><a href="CoreSubst.html#t:Subst">Subst</a></code> left-to-right
</p></div></div><div class="top"><p class="src"><a name="v:substRecBndrs" class="def">substRecBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Id">Id</a>])</p><div class="doc"><p>Substitute in a mutually recursive group of <code><a href="Var.html#t:Id">Id</a></code>s
</p></div></div><div class="top"><p class="src"><a name="v:cloneBndr" class="def">cloneBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="Unique.html#t:Unique">Unique</a> -&gt; <a href="Var.html#t:Var">Var</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="Var.html#t:Var">Var</a>)</p></div><div class="top"><p class="src"><a name="v:cloneBndrs" class="def">cloneBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; [<a href="Var.html#t:Var">Var</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Var">Var</a>])</p></div><div class="top"><p class="src"><a name="v:cloneIdBndr" class="def">cloneIdBndr</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; <a href="Var.html#t:Id">Id</a> -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, <a href="Var.html#t:Id">Id</a>)</p><div class="doc"><p>Very similar to <code><a href="CoreSubst.html#v:substBndr">substBndr</a></code>, but it always allocates a new <code><a href="Unique.html#t:Unique">Unique</a></code> for
 each variable in its output.  It substitutes the IdInfo though.
</p></div></div><div class="top"><p class="src"><a name="v:cloneIdBndrs" class="def">cloneIdBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Id">Id</a>])</p><div class="doc"><p>Applies <code><a href="CoreSubst.html#v:cloneIdBndr">cloneIdBndr</a></code> to a number of <code><a href="Var.html#t:Id">Id</a></code>s, accumulating a final
 substitution from left to right
</p></div></div><div class="top"><p class="src"><a name="v:cloneRecIdBndrs" class="def">cloneRecIdBndrs</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; <a href="UniqSupply.html#t:UniqSupply">UniqSupply</a> -&gt; [<a href="Var.html#t:Id">Id</a>] -&gt; (<a href="CoreSubst.html#t:Subst">Subst</a>, [<a href="Var.html#t:Id">Id</a>])</p><div class="doc"><p>Clone a mutually recursive group of <code><a href="Var.html#t:Id">Id</a></code>s
</p></div></div><h2 id="g:5">Simple expression optimiser
</h2><div class="top"><p class="src"><a name="v:simpleOptPgm" class="def">simpleOptPgm</a> :: <a href="DynFlags.html#t:DynFlags">DynFlags</a> -&gt; <a href="Module.html#t:Module">Module</a> -&gt; <a href="CoreSyn.html#t:CoreProgram">CoreProgram</a> -&gt; [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>] -&gt; [<a href="CoreSyn.html#t:CoreVect">CoreVect</a>] -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="CoreSyn.html#t:CoreProgram">CoreProgram</a>, [<a href="CoreSyn.html#t:CoreRule">CoreRule</a>], [<a href="CoreSyn.html#t:CoreVect">CoreVect</a>])</p></div><div class="top"><p class="src"><a name="v:simpleOptExpr" class="def">simpleOptExpr</a> :: <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a></p></div><div class="top"><p class="src"><a name="v:simpleOptExprWith" class="def">simpleOptExprWith</a> :: <a href="CoreSubst.html#t:Subst">Subst</a> -&gt; InExpr -&gt; OutExpr</p></div><div class="top"><p class="src"><a name="v:exprIsConApp_maybe" class="def">exprIsConApp_maybe</a> :: <a href="CoreSyn.html#t:IdUnfoldingFun">IdUnfoldingFun</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="DataCon.html#t:DataCon">DataCon</a>, [<a href="Type.html#t:Type">Type</a>], [<a href="CoreSyn.html#t:CoreExpr">CoreExpr</a>])</p><div class="doc"><p>Returns <code>Just (dc, [t1..tk], [x1..xn])</code> if the argument expression is 
 a *saturated* constructor application of the form <code>dc t1..tk x1 .. xn</code>,
 where t1..tk are the *universally-qantified* type args of <code>dc</code>
</p></div></div><div class="top"><p class="src"><a name="v:exprIsLiteral_maybe" class="def">exprIsLiteral_maybe</a> :: <a href="CoreSyn.html#t:IdUnfoldingFun">IdUnfoldingFun</a> -&gt; <a href="CoreSyn.html#t:CoreExpr">CoreExpr</a> -&gt; <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Literal.html#t:Literal">Literal</a></p></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>