<br><br><div class="gmail_quote">On Sun, Nov 1, 2009 at 2:00 AM, Michael Vanier <span dir="ltr">&lt;<a href="mailto:mvanier42@gmail.com">mvanier42@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Gregory Collins wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Tom Davie &lt;<a href="mailto:tom.davie@gmail.com" target="_blank">tom.davie@gmail.com</a>&gt; writes:<br>
<br>
  <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/31/09, Magicloud Magiclouds &lt;<a href="mailto:magicloud.magiclouds@gmail.com" target="_blank">magicloud.magiclouds@gmail.com</a>&gt; wrote:<br>
    <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
After all, I never think OO as an oppsite way to all other things. The<br>
idea is so general that if you say I cannot use it in Haskell at all,<br>
that would make me feel weird. The only difference between languages<br>
is, some are easy to be in OO style, some are not.<br>
      <br>
</blockquote>
Wow, someone drank the cool aid!<br>
    <br>
</blockquote>
<br>
Doing OO-style programming in Haskell is difficult and unnatural, it&#39;s<br>
true (although technically speaking it is possible). That said, nobody&#39;s<br>
yet to present a convincing argument to me why Java gets a free pass for<br>
lacking closures and typeclasses.<br>
<br>
G.<br>
  <br>
</blockquote></div>
Because most programmers have never heard of closures and typeclasses, and thus have no idea how useful they are? :-(<br>
<br>
BTW using existential types in Haskell you can mimic OO to a pretty decent degree, at least as far as interfaces are concerned.<br></blockquote><div><br></div><div>I kind of wish we had some convenience notation for doing value-based dispatch like that.... Something like</div>
<div><br></div><div>foo :: [ &lt;Show&gt; ] -&gt; String</div><div>foo xs = concatMap show xs</div><div><br></div><div>&gt; foo [ 5, True, 1.3 ]</div><div>&quot;5True1.3&quot;</div></div><div><br></div><div><br></div>(where wrapping a class up in angle brackets makes it into an existentially qualified wrapper, which is instantiated in the class itself -- maybe we need explicit conversion from e.g. Int to &lt;Show&gt; though...)<div>
<br></div><div>You don&#39;t need it very often, but I wonder if that&#39;s because there genuinely isn&#39;t a need, or if you tend to avoid writing code in ways which would need it (ask a Java programmer, and they&#39;ll probably tell you that the need for type classes and closures don&#39;t come up very often - which is clearly untrue for a Haskell programmer).<br clear="all">
<br>-- <br>Sebastian Sylvan<br>
</div>