I have a problem with overloading in gofer, which I hope someone might

be able to help me with. I wish to define a type class C, with a

predicate f, whose default value is false. I then wish to include the

data type of sets in this class. My script looks like:

class C a where

f:: a -> Bool

f x = False

data Set a = Set [a]

instance C (Set a)

This works ok e.g.

? f (Set [1])

False

(2 reductions, 13 cells)

? f (Set ["hello", "world"])

False

(2 reductions, 17 cells)

However, it doesn't work if I apply f to the empty set:

? f (Set [])

ERROR: Unresolved overloading

*** type : C (Set a) => Bool

*** translation : f (Set [])

I appreciate that I can fix this by explicitly stating the type of the

set, but for my application this won't always be possible.

Hence, can anyone suggest a way round this problem of empty sets,

other than explicit typing?

TIA

Paul.

====================================================================

School of Computer Studies | tel: 0113 233 5193

University of Leeds | fax: 0113 233 5468

Leeds LS2 9JT. |

====================================================================