You might find this <a href="http://haskell.org/haskellwiki/OOP_vs_type_classes">http://haskell.org/haskellwiki/OOP_vs_type_classes</a> also useful.<br>Cheers<br>Ram<br><br><div class="gmail_quote">On Wed, Jan 27, 2010 at 3:27 PM, Henk-Jan van Tuyl <span dir="ltr">&lt;<a href="mailto:hjgtuyl@chello.nl">hjgtuyl@chello.nl</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;"><br>
I have the experience that you better start from scratch when learning a new programming paradigm, do not try to write object oriented programs in Haskell. A great description of how to use the functional programming paradigm can be found in &quot;Why Functional Programming Matters&quot; [1]. Maybe also interesting is &quot;The Monad.Reader/Issue3/Functional Programming vs Object Oriented Programming&quot; [2].<br>

<br>
[1] <a href="http://www.cs.chalmers.se/%7Erjmh/Papers/whyfp.html" target="_blank">http://www.cs.chalmers.se/~rjmh/Papers/whyfp.html</a><br>
[2] <a href="http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue3/Functional_Programming_vs_Object_Oriented_Programming" target="_blank">http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue3/Functional_Programming_vs_Object_Oriented_Programming</a><br>

<br>
Regards,<br>
Henk-Jan van Tuyl<br>
<br>
<br>
--<br>
<a href="http://Van.Tuyl.eu/" target="_blank">http://Van.Tuyl.eu/</a><br>
<a href="http://members.chello.nl/hjgtuyl/tourdemonad.html" target="_blank">http://members.chello.nl/hjgtuyl/tourdemonad.html</a><br><font color="#888888">
--</font><div><div></div><div class="h5"><br>
<br>
<br>
On Wed, 27 Jan 2010 23:43:27 +0100, Joe Van Dyk &lt;<a href="mailto:joe@fixieconsulting.com" target="_blank">joe@fixieconsulting.com</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks, I&#39;m starting to get it.<br>
<br>
Perhaps what I need to do is take a small standard OOP system and try<br>
converting it to FP.<br>
<br>
Or perhaps there&#39;s already examples of such a thing I could look at?<br>
<br>
Joe<br>
<br>
On Wed, Jan 27, 2010 at 11:43 AM, Stephen Blackheath [to<br>
Haskell-Beginners] &lt;<a href="mailto:mutilating.cauliflowers.stephen@blacksapphire.com" target="_blank">mutilating.cauliflowers.stephen@blacksapphire.com</a>&gt;<br>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Joe,<br>
<br>
IMHO:<br>
<br>
Classes in OOP have several purposes, one of which is to manage the mutation<br>
of state so as to put a lid on the complexity that could result.  The inside<br>
of an OOP class is usually a C program, and the outside is (ideally) a<br>
semi-functional program with interfaces that are simple at the level of<br>
abstraction where they operate.  The single responsibility principle exists<br>
to stop the C programs getting big and messy, and to help the programmer to<br>
build neat layers of abstraction on top of each other by having more<br>
abstract classes constructed out of less abstract ones.<br>
<br>
Functional programming essentially takes the C part away and makes the whole<br>
program into a layering of abstractions, even at the lowest level.<br>
<br>
An FP function more-or-less maps to an OOP class, and the reason why it can<br>
be a much lighter-weight structure is because the need to manage mutation<br>
has been removed.  I think the same principle applies, though - an FP<br>
function should have only one responsibility.<br>
<br>
Perhaps in FP the need for this principle to be explicitly stated and<br>
carefully observed is not so great, though.  If an FP function does two<br>
things and can be split up, it&#39;s not such a big deal, because re-factoring<br>
is easy in an FP language.  By comparison in OOP, splitting a big messy<br>
class up is a lot of work with a great risk of breakage. This amplifies the<br>
importance of applying the single responsibility principle before you start<br>
writing the class.<br>
<br>
<br>
Steve<br>
<br>
Joe Van Dyk wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
So I&#39;m still pretty new to functional programming.<br>
<br>
In OOP, you have the concept of each class having a<br>
single-responsibility (or reason for changing).  See<br>
<a href="http://en.wikipedia.org/wiki/Single_responsibility_principle" target="_blank">http://en.wikipedia.org/wiki/Single_responsibility_principle</a><br>
<br>
I&#39;m having problems seeing how that concept maps to functional<br>
programming.  Perhaps it doesn&#39;t?<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
<br>
-- <br></div></div><div><div></div><div class="h5">
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br>