<div dir="ltr"><div><div><div><div><div>>> What is confusing to me is the recursion on the let construct.<br>Oh sry I may have misunderstood your question then.<br><br>You can think of defining 'forever' itself as a let construct. Starting from the "simpler" implementation:<br>
<br></div>let forever a = a >> forever a<br><br></div>Now let's just give the rhs another name, again using 'let':<br><br></div>let forever a = (let a' = a >> forever a in a')<br><br></div>
But we can see that a' is actually equal to (forever a), so we can replace on in the rhs:<br><br></div><div>let forever a = (let a' = a >> a' in a')<br><br></div><div>There is no trickery, no getting away, this recursion is the same as what you have thought of:)<br>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 December 2013 02:46, Eduardo Sato <span dir="ltr"><<a href="mailto:eduardo.sato@gmail.com" target="_blank">eduardo.sato@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tuesday, December 24, 2013, Clark Gaebel  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">
forever :: Monad m => m a -> m b<br></div><div class="gmail_default" style="font-family:verdana,sans-serif">forever a = a >> forever a<br></div></div></blockquote><div><br></div></div><div>Thanks for your response. This is actually how I would have implemented it. </div>

<div><br></div>What is confusing to me is the recursion on the let construct.<div><br></div><div>What is not clear to me is when we can "get away" with doing that kind of thing. I mentioned the "tying the knot article" because it, too, uses recursion on a let construct. </div>

<div><br></div>--<div>Eduardo Sato <span></span></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>