YES
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http:/www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>H-Termination proof of ../tpdb/FP/full_haskell/Monad_ap_4.hs</title>
</head>
<body>
<BR><B>H-Termination</B> of the given <I>Haskell-Program with start terms</I> could successfully be <font color=#00ff00>proven</font>:<BR><BR><BR><BR><pre>&#8627 <B>HASKELL</B></pre><pre>  &#8627 LR</pre><BR><html>
<body>mainModule Main<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>
                   &nbsp;
                </td><td>((<FONT COLOR="#000088">Monad.ap</FONT> :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>) :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>)</td>
</tr>
</table>
<br>module Main where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Maybe<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>module Monad where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Maybe<br>import qualified Prelude<br>
<br>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">ap</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">a</FONT> =&gt; <FONT COLOR="#000088">a</FONT> (<FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT> <FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT> <FONT COLOR="#000088">b</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">ap</FONT>&nbsp;</td><td valign="top"></td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> <FONT COLOR="#000088">id</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">d</FONT> =&gt; (<FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT> <FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT> <FONT COLOR="#000088">a</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM2</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">m2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;(\<FONT COLOR="#000088">x1</FONT>&nbsp;-&gt;<FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;(\<FONT COLOR="#000088">x2</FONT>&nbsp;-&gt;<FONT COLOR="#000088">return</FONT> (<FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT> <FONT COLOR="#000088">x2</FONT>)))</td>
</tr>
</table>
<BR>
</td>
</tr>
</table>
<br>module Maybe where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>
</body>
</html>
<BR>Lambda Reductions:<BR>The following Lambda expression<BR><BLOCKQUOTE>\<font color=#000088>x2</font>&#8594;<font color=#000088>return</font>&#160;(<font color=#000088>f</font>&#160;<font color=#000088>x1</font>&#160;<font color=#000088>x2</font>)</BLOCKQUOTE><BR>is transformed to<BR><BLOCKQUOTE><table cellspacing="0" cellpadding="0" border="0" frame="void" >
<tr><td valign="top"><font color=#000088>liftM20</font>&#160;</td><td valign="top"><font color=#000088>f</font>&#160;<font color=#000088>x1</font>&#160;<font color=#000088>x2</font></td><td valign="top">&#160;=&#160;<font color=#000088>return</font>&#160;(<font color=#000088>f</font>&#160;<font color=#000088>x1</font>&#160;<font color=#000088>x2</font>)</td></tr>
</table></BLOCKQUOTE><BR>The following Lambda expression<BR><BLOCKQUOTE>\<font color=#000088>x1</font>&#8594;<font color=#000088>m2</font>&#160;<font color=#000088>>>=</font>&#160;<font color=#000088>liftM20</font>&#160;<font color=#000088>f</font>&#160;<font color=#000088>x1</font></BLOCKQUOTE><BR>is transformed to<BR><BLOCKQUOTE><table cellspacing="0" cellpadding="0" border="0" frame="void" >
<tr><td valign="top"><font color=#000088>liftM21</font>&#160;</td><td valign="top"><font color=#000088>m2</font>&#160;<font color=#000088>f</font>&#160;<font color=#000088>x1</font></td><td valign="top">&#160;=&#160;<font color=#000088>m2</font>&#160;<font color=#000088>>>=</font>&#160;<font color=#000088>liftM20</font>&#160;<font color=#000088>f</font>&#160;<font color=#000088>x1</font></td></tr>
</table></BLOCKQUOTE><BR><BR><BR><pre>&#8627 HASKELL</pre><pre>  &#8627 LR</pre><pre>    &#8627 <B>HASKELL</B></pre><pre>      &#8627 BR</pre><BR><html>
<body>mainModule Main<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>
                   &nbsp;
                </td><td>((<FONT COLOR="#000088">Monad.ap</FONT> :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>) :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>)</td>
</tr>
</table>
<br>module Main where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Maybe<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>module Maybe where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>module Monad where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Maybe<br>import qualified Prelude<br>
<br>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">ap</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">a</FONT> =&gt; <FONT COLOR="#000088">a</FONT> (<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT> <FONT COLOR="#000088">c</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">ap</FONT>&nbsp;</td><td valign="top"></td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> <FONT COLOR="#000088">id</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">b</FONT> =&gt; (<FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT> <FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT> <FONT COLOR="#000088">d</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT> <FONT COLOR="#000088">a</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM2</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">m2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;<FONT COLOR="#000088">liftM21</FONT> <FONT COLOR="#000088">m2</FONT> <FONT COLOR="#000088">f</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM20</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">x1</FONT>&nbsp;<FONT COLOR="#000088">x2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">return</FONT> (<FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT> <FONT COLOR="#000088">x2</FONT>)</td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM21</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">x1</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;<FONT COLOR="#000088">liftM20</FONT> <FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
</table>
<br>
</body>
</html>
<BR>Replaced joker patterns by fresh variables and removed binding patterns.<BR><BR><pre>&#8627 HASKELL</pre><pre>  &#8627 LR</pre><pre>    &#8627 HASKELL</pre><pre>      &#8627 BR</pre><pre>        &#8627 <B>HASKELL</B></pre><pre>          &#8627 NumRed</pre><BR><html>
<body>mainModule Main<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>
                   &nbsp;
                </td><td>((<FONT COLOR="#000088">Monad.ap</FONT> :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>) :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>)</td>
</tr>
</table>
<br>module Main where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Maybe<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>module Monad where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Maybe<br>import qualified Prelude<br>
<br>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">ap</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">c</FONT> =&gt; <FONT COLOR="#000088">c</FONT> (<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">a</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">ap</FONT>&nbsp;</td><td valign="top"></td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> <FONT COLOR="#000088">id</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">d</FONT> =&gt; (<FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT> <FONT COLOR="#000088">c</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT> <FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT> <FONT COLOR="#000088">b</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM2</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">m2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;<FONT COLOR="#000088">liftM21</FONT> <FONT COLOR="#000088">m2</FONT> <FONT COLOR="#000088">f</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM20</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">x1</FONT>&nbsp;<FONT COLOR="#000088">x2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">return</FONT> (<FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT> <FONT COLOR="#000088">x2</FONT>)</td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM21</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">x1</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;<FONT COLOR="#000088">liftM20</FONT> <FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
</table>
<br>module Maybe where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>
</body>
</html>
<BR>Num Reduction:All numbers are transformed to thier corresponding representation with Succ, Pred and Zero.<BR><BR><pre>&#8627 HASKELL</pre><pre>  &#8627 LR</pre><pre>    &#8627 HASKELL</pre><pre>      &#8627 BR</pre><pre>        &#8627 HASKELL</pre><pre>          &#8627 NumRed</pre><pre>            &#8627 <B>HASKELL</B></pre><pre>              &#8627 Narrow</pre><BR><html>
<body>mainModule Main<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>
                   &nbsp;
                </td><td>(<FONT COLOR="#000088">Monad.ap</FONT> :: <FONT COLOR="#666600">IO</FONT> (<FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#666600">IO</FONT> <FONT COLOR="#000088">b</FONT>)</td>
</tr>
</table>
<br>module Main where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Maybe<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>module Maybe where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Monad<br>import qualified Prelude<br>
<br>
</td>
</tr>
</table>
<br>module Monad where<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">import qualified Main<br>import qualified Maybe<br>import qualified Prelude<br>
<br>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">ap</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">c</FONT> =&gt; <FONT COLOR="#000088">c</FONT> (<FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">b</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">ap</FONT>&nbsp;</td><td valign="top"></td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> <FONT COLOR="#000088">id</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top"><FONT COLOR="#000088">liftM2</FONT> :: <FONT COLOR="#666600">Monad</FONT> <FONT COLOR="#000088">c</FONT> =&gt; (<FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">d</FONT>)&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">a</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">b</FONT>&nbsp;<FONT COLOR="#666600">&nbsp;-&gt;&nbsp;</FONT>&nbsp;<FONT COLOR="#000088">c</FONT> <FONT COLOR="#000088">d</FONT>
<br>
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM2</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">m2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m1</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;<FONT COLOR="#000088">liftM21</FONT> <FONT COLOR="#000088">m2</FONT> <FONT COLOR="#000088">f</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM20</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">x1</FONT>&nbsp;<FONT COLOR="#000088">x2</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">return</FONT> (<FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT> <FONT COLOR="#000088">x2</FONT>)</td>
</tr>
</table>
<BR>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;</td><td valign="top">
<table cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td valign="top"><FONT COLOR="#000088">liftM21</FONT>&nbsp;</td><td valign="top"><FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">f</FONT>&nbsp;<FONT COLOR="#000088">x1</FONT>&nbsp;</td><td valign="top">=&nbsp;</td><td valign="top"><FONT COLOR="#000088">m2</FONT>&nbsp;<FONT COLOR="#000088">&gt;&gt;=</FONT>&nbsp;<FONT COLOR="#000088">liftM20</FONT> <FONT COLOR="#000088">f</FONT> <FONT COLOR="#000088">x1</FONT></td>
</tr>
</table>
<BR>
</td>
</tr>
</table>
<br>
</body>
</html>
<BR>Haskell To QDPs<BR><textarea cols="80" rows="25">digraph dp_graph {
node [outthreshold=100, inthreshold=100];1[label="Monad.ap\n",fontsize=16,color="grey",shape="box"];1 -> 3[label="",style="dashed", color="grey", weight=3];
3[label="Monad.ap vy3\n",fontsize=16,color="grey",shape="box"];3 -> 4[label="",style="dashed", color="grey", weight=3];
4[label="Monad.ap vy3 vy4\n",fontsize=16,color="black",shape="triangle"];4 -> 5[label="",style="solid", color="black", weight=3];
5[label="Monad.liftM2 id vy3 vy4\n",fontsize=16,color="black",shape="box"];5 -> 6[label="",style="solid", color="black", weight=3];
6[label="vy3 >>= Monad.liftM21 vy4 id\n",fontsize=16,color="black",shape="box"];6 -> 7[label="",style="solid", color="black", weight=3];
7[label="primbindIO vy3 (Monad.liftM21 vy4 id)\n",fontsize=16,color="black",shape="box"];7 -> 8[label="",style="solid", color="black", weight=3];
8[label="terminator vy3 (Monad.liftM21 vy4 id)\n",fontsize=16,color="black",shape="box"];8 -> 9[label="",style="solid", color="black", weight=3];
9[label="ter0m vy3 (Monad.liftM21 vy4 id)\n",fontsize=16,color="green",shape="box"];9 -> 10[label="",style="dashed", color="green", weight=3];
9 -> 11[label="",style="dashed", color="green", weight=3];
10[label="vy3\n",fontsize=16,color="green",shape="box"];11[label="Monad.liftM21 vy4 id\n",fontsize=16,color="grey",shape="box"];11 -> 12[label="",style="dashed", color="grey", weight=3];
12[label="Monad.liftM21 vy4 id vy5\n",fontsize=16,color="black",shape="triangle"];12 -> 13[label="",style="solid", color="black", weight=3];
13[label="vy4 >>= Monad.liftM20 id vy5\n",fontsize=16,color="black",shape="box"];13 -> 14[label="",style="solid", color="black", weight=3];
14[label="primbindIO vy4 (Monad.liftM20 id vy5)\n",fontsize=16,color="black",shape="box"];14 -> 15[label="",style="solid", color="black", weight=3];
15[label="terminator vy4 (Monad.liftM20 id vy5)\n",fontsize=16,color="black",shape="box"];15 -> 16[label="",style="solid", color="black", weight=3];
16[label="ter1m vy4 (Monad.liftM20 id vy5)\n",fontsize=16,color="green",shape="box"];16 -> 17[label="",style="dashed", color="green", weight=3];
16 -> 18[label="",style="dashed", color="green", weight=3];
17[label="vy4\n",fontsize=16,color="green",shape="box"];18[label="Monad.liftM20 id vy5\n",fontsize=16,color="grey",shape="box"];18 -> 19[label="",style="dashed", color="grey", weight=3];
19[label="Monad.liftM20 id vy5 vy6\n",fontsize=16,color="black",shape="triangle"];19 -> 20[label="",style="solid", color="black", weight=3];
20[label="return (id vy5 vy6)\n",fontsize=16,color="black",shape="box"];20 -> 21[label="",style="solid", color="black", weight=3];
21[label="primretIO (id vy5 vy6)\n",fontsize=16,color="black",shape="box"];21 -> 22[label="",style="solid", color="black", weight=3];
22[label="terminator (id vy5 vy6)\n",fontsize=16,color="black",shape="box"];22 -> 23[label="",style="solid", color="black", weight=3];
23[label="ter2m (id vy5 vy6)\n",fontsize=16,color="green",shape="box"];23 -> 24[label="",style="dashed", color="green", weight=3];
24[label="id vy5 vy6\n",fontsize=16,color="black",shape="box"];24 -> 25[label="",style="solid", color="black", weight=3];
25[label="vy5 vy6\n",fontsize=16,color="green",shape="box"];25 -> 26[label="",style="dashed", color="green", weight=3];
26[label="vy6\n",fontsize=16,color="green",shape="box"];}
</textarea><BR><BR></body>


