[clean-list] overloading problem

Divianszky Peter divianp@delfin.unideb.hu
Tue, 22 Jul 2003 16:19:16 +0200 (DFT)


Hi,

I have met a strange overloading problem in Clean:

 import StdEnv

 class C a | zero a where
    c1 :: a
    c2 :: (a -> a)

 instance zero [a] | zero a where zero = ...
 instance C [a] where
    c1 = []
    c2 = f where f _ = c1

=> error "internal overloading of f could not be solved"

This is just a minimal illustration and can be solved in various ways
but I have more serious examples too.

I think it always helps when I specify the type of f.
(I don't understand why is it necessary!)
In my case it is not a good idea; I am working on the Haskell interface.
Please help me!

Peter Divianszky