On 03/01/2011, at 10:36 AM, john skaller wrote:

> 
> For multi-argument functions the inner most function gets a type variable,
> but the enclosing functions have return types using that type variable.
> 
> The problem is, the resulting types are still wrong for overloading, even 
> though
> the inner most return type is not used, until the unbound variable is 
> replaced by
> the computed return value. Dang! At least I didn't do it :)



Oops! No, I'm wrong again: it will work. Consider:

fun catmap[T,N with Str[T]] (sep:string) (f:T -> T) (x:array[T,N]): R => 
  fold_left (fun (acc:string) (x:T) => acc+sep+str (f x)) "" x
;

the type is:

catmap[T,N]: string -> (T->T) -> T^N -> R

and we don't care about the R for overload resolution.
It's quite true what I said: all the nested functions have an R in them.
But that doesn't matter, it's catmap that matters, and its signature is:

  string, T->T, T^N

No R in there.

--
john skaller
[email protected]





------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to