On 23/03/2008, at 12:40 PM, Erick Tryzelaar wrote:
> I was asked by someone in #llvm if felix can do polymorphic recursion,
> and I wasn't sure if we could.
Nope, Felix doesn't have second order polymorphic functions so you
can't even talk
about polymorphic recursion.
If you do
fun f[t] (x:t, g:t->t):t => g(t);
really g isn't polymorphic at all .. the 't' in it is fixed by f. EG:
f (1,g) // f[int], g[int]
Roughly, Felix only allows outermost universal quantification.. the
lambda
binder on the type "t" is only allowed to be universal over the whole
function f, you can't do
lambda t . f : t * (lambda v. v->v) -> t
for example (that v->v is keeping the lambda *inside* so the function
is polymorphic *inside f.)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language