On Sat, 2007-03-24 at 16:11 -0700, Erick Tryzelaar wrote:
> I found an interesting case using Array::find. find has two function 
> signatures:
> 
> fun find[T, N] (eq:T->bool)   (x:array[T, N]): opt[T]
> fun find[T, N] (eq:T*T->bool) (x:array[T, N]) (e:T): opt[T]
> 
> This is all fine, except when the array you're working with is an array 
> of tuples, like this:
> 
> val args = (('foo', 'bar'), ('faa', 'fee'));

Yeh, that's a fun case. 

I ran into another one in the why theorem proving stuff I
previously mentioned:

axiom_check (1,2)

actually triggers BOTH

axiom F[t] (x:t)         // t = int * int
axiom F[t] (x:t, y:t)    // t = int

and the first case requires equality on int * int which
wasn't defined. (That's fixed now, by an instance
of Eq which applies to all pairs).

A partial solution to this is to use the varray's instead:
they're first class arrays, unlike array, which is just sugar
for tuples of elements of the same kind.


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