On Tue, Nov 16, 2010 at 3:34 AM, Ozgur Akgun
<ozgurakgun@gmail.com> wrote:
On 16 November 2010 05:12, Russ Abbott
<russ.abbott@gmail.com> wrote:
I know the code isn't correct. My point is that the compiler didn't complain when the code was loaded, and the interpreter died when it was executed. That shouldn't happen.
-- Russ
It would be cool for GHC to make an analysis about the instance methods of a type class, and their default implementations to find the minimal subset of methods you have to implement to get a valid (for some definition of valid) instance declaration. But it doesn't do such a thing. And it is not an easy task.
GHC only warns you if you do not implement a method which doesn't have a default implementation. In your example, this is not the case.
Best,
--
Ozgur Akgun