<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Sep 30, 2008 at 12:51 AM, apfelmus <span dir="ltr">&lt;<a href="mailto:apfelmus@quantentunnel.de">apfelmus@quantentunnel.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Jason Dagit wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I recently had someone point me to this thread on LtU:<br>
&gt; <a href="http://lambda-the-ultimate.org/node/2003" target="_blank">http://lambda-the-ultimate.org/node/2003</a><br>
&gt;<br>
&gt; The main paper in the article is this one:<br>
&gt; <a href="http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf" target="_blank">http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf</a><br>

&gt;<br>
&gt; It leaves me with several questions:<br>
&gt; 1) Are there are existing Haskell-ish implementations of the total<br>
&gt; functional paradigm?<br>
<br>
</div>Agda?<br>
<br>
 &nbsp;<a href="http://appserv.cs.chalmers.se/users/ulfn/wiki/agda.php?n=Main.HomePage" target="_blank">http://appserv.cs.chalmers.se/users/ulfn/wiki/agda.php?n=Main.HomePage</a><br>
<br>
It seems to me that dependent types are best for ensuring totality.</blockquote><div><br>Bear with me, as I know virtual nothing about dependent types yet.&nbsp; In the total functional paradigm the language lacks a value for bottom.&nbsp; This means general recursion is out and in the paper I cited it was replaced with structural recursion on the inputs.&nbsp; How do dependent types remove bottom from the language?<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><div class="Ih2E3d">
&gt; 2) Could we restructure Haskell so that it comes in 3 layers, total<br>
&gt; functional core, lazy pure partial functional middle, and IO outer layer?<br>
<br>
</div>The IO layer can be interpreted as &quot;co-total&quot;, i.e. as codata.<br>
Basically, this means that it&#39;s guaranteed that the program prints or<br>
reads something after a finite amount of time and does not loop forever<br>
without doing anything.</blockquote><div><br>I was asserting that Haskell is currently 2 layered.&nbsp; Purely functional vs. IO.&nbsp; They integrate nicely and play well together, but I still think of them as distinct layers.&nbsp; Perhaps this is not fair or confusing though.&nbsp; The paper I cited did indeed use codata to define streams so that something, such as an OS, that needs to process infinite streams of requests can still do so.<br>
<br>Thanks,<br>Jason<br></div></div></div>