Oh, nice! We live in an egalitarian society.
Everyone is equal. Well, potentially equal,
no matter how long in the toople you are ..
// general case
instance [T,U with Eq[T], Eq[U]] Eq[T ** U] {
fun == : (T ** U) * (T ** U) -> bool =
| (?ah ,, ?at) , (?bh ,, ?bt) => ah == bh and at == bt;
;
}
// pair
instance[t,u with Eq[t],Eq[u]] Eq[t*u] {
fun == : (t * u) * (t * u) -> bool =
| (?x1,?y1),(?x2,?y2) => x1==x2 and y1 == y2
;
}
// array pair
instance[t with Eq[t]] Eq[t*t] {
fun == : (t * t) * (t * t) -> bool =
| (?x1,?y1),(?x2,?y2) => x1==x2 and y1 == y2
;
}
open [T] Eq[T];
y1 := (1,"x",4.2,"x",55,"hello",4.222);
y2 := (1,"x",4.2,"y",55,"hello",4.222);
println$ y1 == y2;
Note: 6 components. Old library only supported up to 5!
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language