<div dir="ltr">On Sat, Sep 1, 2012 at 6:46 PM, Dennis Raddle <span dir="ltr">&lt;<a href="mailto:dennis.raddle@gmail.com" target="_blank">dennis.raddle@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does literate programming in haskell (.lhs) support the idea in Knuth&#39;s WEB of using aliases for blocks of code? In other words doing something like<br><br>main = do<br>  &lt;part 1&gt;<br>  &lt;part 2&gt;<br><br>&lt;part 1&gt; === putStrLn &quot;foo&quot;<br>

&lt;part 2&gt; === putStrLn &quot;bar&quot;<br><br>(except I don&#39;t know what the actual syntax is)</blockquote><div><br></div><div>No, and it&#39;s not as necessary in Haskell as it was in Pascal because it&#39;s easier (and preferred) to break programs up into smaller functions anyway.  So your &lt;part 1&gt; is just part1, and the definition of part1 follows later.  (Consider that we don&#39;t throw around state in variables quite as wontonly; and when we *do* need to, we can stuff it in a state monad.)</div>
<div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>