Re: [Felix-language] Tuple consing

2012-09-06 Thread john skaller
Interestingly, we can still do these two in the compiler with a caveat: tuple_map (f,g) (a,b) --> (f a, g b) generic_map f (a,b) --> (f a, f b) provided we don't get into a type recursion. The trick is to bind the arguments first. The result type can't be known until after this is

[Felix-language] Tuple consing

2012-09-06 Thread john skaller
I did some more work and got this to go: class Applicable[A,D,C] { virtual fun myapply : A * D -> C; } instance[DH,DT,CH,CT] Applicable[ (DH -> CH) * (DT -> CT), DH * DT, CH * CT] { fun myapply : ((DH->CH) * (DT->CT)) * (DH * DT) -> CH * CT = | (?ah , ?at) , (?dh, ?dt) => ah dh, at dt ; }