[clean-list] overloading problem
Ton van Heugten
Tue, 3 Apr 2001 16:05:25 -0700 (PDT)
<<I've got a little problem with the following
Maybe the following will work:
:: Set a :== [a]
isinset :: a (Set a) -> Bool | ==a
isinset x set=isMember x set
intersect :: (Set a) (Set a) -> (Set a) | ==a
intersect x y=[r \\ r <- x | (isinset r y)]
I do not have clean working on my computer so I didn't
test this,hope it helps.
> Hello cleaners!
> I've got a little problem with the following
> import StdEnv,StdList
> :: Set a :== [a]
> isinset :: a (Set a) -> Bool | ==a
> isinset x set=isMember x set
> intersect :: (Set a) (Set a) -> (Set a) | ==a
> intersect  =
> intersect x y=[r \\ r <- x | (isinset r y)]
> When I do "Start=(intersect  )" I get the
> following Error:
> "Start" cannot be overloaded: Set a | ==a"
> Whereas when I do "Start=(intersect [1,2,3] [2,3,4]"
> I get the correct
> What am I doing wrong?
> Best regards,
> clean-list mailing list
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.