[clean-list] overloading problem

Ton van Heugten tonvanheugten@yahoo.com
Tue, 3 Apr 2001 16:05:25 -0700 (PDT)


Hello Marc:

<<I've got a little problem with the following
program:>>

Maybe the following  will work:

     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 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.

Best wishes
Ton
van Heugten
mail: tonvanheugten@forum.be
--

original message:

> Hello cleaners!
> 
> I've got a little problem with the following
> program:
> 
>      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
> answer.
> What am I doing wrong?
>   
> 
> -- 
> Best regards,
>  Marc/Pop                         
> mailto:marc.poppleton@wanadoo.fr
> 
> 
> 
> _______________________________________________
> clean-list mailing list
> clean-list@cs.kun.nl
> http://www.cs.kun.nl/mailman/listinfo/clean-list


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/