<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I think my brain just exploded.<div><br><div><div>On Mar 30, 2009, at 1:29 PM, Edward Kmett wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>First, BASIC, now C. What's next, Haskell?&nbsp; =)</div> <div>&nbsp;</div> <div>-Edward Kmett<br><br></div> <div class="gmail_quote">On Sun, Mar 29, 2009 at 5:16 AM, Lennart Augustsson <span dir="ltr">&lt;<a href="mailto:lennart@augustsson.net">lennart@augustsson.net</a>&gt;</span> wrote:<br> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I've uploaded my CMonad package to Hackage. &nbsp;It allows you to write<br>Haskell code in a C style.<br>Unfortunately, GHC lacks certain optimizations to make efficient code<br> when using CMonad,<br>so instead of C speed you get low speed.<br><br>Example: Computing some Fibonacci numbers:<br>fib = do {<br>&nbsp; &nbsp;a &lt;- arrayU[40];<br>&nbsp; &nbsp;i &lt;- auto 0;<br>&nbsp; &nbsp;a[0] =: 1;<br>&nbsp; &nbsp;a[1] =: 1;<br>&nbsp; &nbsp;for (i =: 2, (i :: EIO Int) &lt; 40, i += 1) $ do {<br> &nbsp; &nbsp; &nbsp; &nbsp;a[i] =: a[i-1] + a[i-2];<br>&nbsp; &nbsp;};<br>&nbsp; &nbsp;retrn (a[39]);<br>&nbsp;}<br><br><br>Example: Copying stdin to stdout:<br>cat = do {<br>&nbsp; &nbsp;c &lt;- auto 0;<br><br>&nbsp; &nbsp;while ((c =: getchar()) &gt;= 0) $ do {<br>&nbsp; &nbsp; &nbsp; &nbsp;putchar(c);<br> &nbsp; &nbsp;};<br>&nbsp; &nbsp;return ();<br>&nbsp;}<br><br>&nbsp; &nbsp;-- Lennart<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> </blockquote></div><br> _______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></blockquote></div><br></div></body></html>