Erick Tryzelaar wrote:
> Assuming I had a typeclass like this:
>
> typeclass Show[t] {
> virtual fun show: t -> string;
> }
>
> How can I define a function to convert a tuple? I'm not sure how I
> specify that it uses two typeclasses. This is what I tried and got a
> parse error:
>
> fun show[T,U with Show[T], Show[U]] ((x,y):T*U):string =>
> '(' + (show x) + ', ' + (show y) + ')'
> ;
Duh, it wasn't a typeclass issue:
fun show[T,U with Show[T], Show[U]] (x:T,y:U):string =>
'(' + (show x) + ', ' + (show y) + ')'
;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language