User talk:GRiba2010

Classes and types
Hello GRiba2010! Welcome to Wikibooks, and to the Haskell Wikibook too!

I have seen the section you added to Classes and Types, and I am not sure if it fits that chapter. The issue is that, if the method of the inheriting type class can be defined exclusively in terms of the base class, then in principle it does not need a separate class for itself. In your example,  could be a method of   with a default implementation, or simply a regular function with a   constraint. I fear that showing   defined in a separate class may lead newbies to believe they need extra type classes more often than they really do.

A secondary point is usage of GHC extensions. I feel it is better to keep usage of extensions to a minimum in the Beginner's Track, especially those which, like  aren't just syntactic sugar (, OTOH, might be fine - I will look for a way to mention it when discussing records).

I might be missing out something, though, so I would like to hear your take on that before changing anything.

Cheers, Duplode (discuss • contribs) 20:00, 24 October 2013 (UTC)


 * The idea behind keeping different classes PropXY and IFun2D is to detach functionality from structure, but I agree with you that they can be merged with a default implementation, so feel free to rewrite the example to fit the teaching level. GRiba2010 (discuss • contribs) 15:12, 25 October 2013 (UTC)


 * On second thought, I noticed that (i) what struck me as odd about  was that if   covers both getting and setting the coordinates then   can be implemented straight away in terms of the   methods; and (ii) my concerns aside, your example neatly displayed the various features presented in the chapter in one place. With those two things in mind, I ended up reimagining (subverting?) your example into a chapter-closing demo... Duplode (discuss • contribs) 02:04, 26 October 2013 (UTC)
 * P.S.: I moved your reply here because the (rather awkward) convention is to keep the whole thread in a single page, for readability.