Hi!

Surely this is obvious, but I cannot figure out how to properly deal with
class constraints and monads. For instance, when trying 

instance Monad Set.Set where 
  xs >>= f     =  Set.unionSet (Set.map f xs)
  return x     =  Set.single x
  fail s       =  Set.empty

hugs complains that it "Cannot justify constraints in instance member
binding" for >>=. unionSet type is Eq a => Set (Set a) -> Set a

Thanks,

kirstin

-- 
Always look over your shoulder because everyone is watching and plotting
against you.

Reply via email to