On Thu, 2006-10-05 at 10:34 -0700, Erick Tryzelaar wrote:
> I got a couple questions after my first attempt with the new 
> typeclasses. First off, is it possible to call a function directly from 
> an instance?

No, not at the moment. The current implementation is heavily
restricted, some of the restrictions will get lifted.


> 
> Second, typeclasses support recursive types, right? If so, how do I use 
> them? I couldn't get this section to compile:
> 
> ///////////////////////////////////
> open List;
> 
> fun foo[T with Str[T]] (x:list[T]):string =>
>   match x with
>   | Empty[T] => "()"
>   | Cons(?h, ?t) => "(" + (str2 h) + ", " + (foo x) + ")"
>   endmatch
> ;
> ///////////////////////////////////
> 
> 
> It errors out with this:
> 
> 
> Flx_exceptions.ClientError2(_, _, "Instantiate virtual function(2) str2")

Ok, I get that too.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

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

Reply via email to