On Mon, 2006-11-06 at 19:50 +1100, Jonathan Kelly wrote:
> Hi,
> 
> getting errors about eq that used to work, obviously about the type 
> classes thing ...

Yeah, this is going to be a hassle for a while.

I'm in the middle of upgrading the standard library to use
typeclasses more or less exclusively for basic operations.


> $ flx --force t2/fibheap.flx
> CLIENT ERROR
> [resolve_overload] Ambiguous call: Not expecting equal signatures
> (1) fun 5476:<T5477> * <T5477>
> (2) fun 1636:<T1632> * <T1632>


> See: /usr/local/lib/felix/felix-1.1.3_rc1/lib/flx_tclass.flxh: line 10, 
> cols 11 to 32
>  9: typeclass Eq[t] {
> 10:   virtual fun eq: t * t -> bool;
>               **********************
> 11:   virtual fun ne (x:t,y:t):bool => not (eq (x,y));
> 
> See: t2/dll.flx: line 11, cols 5 to 40
> 10: module DLL {
> 11:     fun eq[T]: T * T -> bool = "$1==$2";
>         ************************************
> 12:

The definition inside the module should have precedence
inside the module.

> //---------------
> 
> In my code I had this ...
> 
>     fun eq[T]: T * T -> bool = "$1==$2";
> 
>     fun eql[T] (x:T) (y:T):bool => eq(x, y);
> 
> to support this
> 
>                 if (mem (eql head) been) == false do
> 
> if I change the eq to equal, I get this
> 
> $ flx --force t2/fibheap.flx
> CLIENT ERROR
> [lookup_name_with_sig] Can't find eq of bool^2
> In t2/dll.flx: line 60, cols 42 to 43
> 59:             {
> 60:                 if (mem (eql head) been) == false do
>                                              **
> 61:                     prnt head.item;


Probably because the standard library doesn't define 
an instance for Eq[bool]..


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

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to