Fergus wrote:
> | If no binding is given for some class method then the corresponding
> | default class method in the class declaration is used (if present);
> | if such a default does not exist then the class method of this
> | instance is bound to undefined and no compile-time error results.
>
> But I think it would be better if the last two lines were replaced
> with
>
> | if such a default does not exist then a compile-time error results.
>
> The existence of this loop-hole compromises Haskell's static type
> safety.
I am quite happy with not getting a compile-time error for
non-implemented class methods, as long as I get a compile-time error
when I try to use a non-implemented class method.
I mean
> class Foo t where
> g :: t -> Int
>
> data Blob = One | Two
>
> instance Foo Blob where ;
looks ok without error; but adding
> y = g One
should result in an error I think. Waiting until runtime is bad.
(sorry if this was beside the point)
Bart Demoen