Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] currying...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sven LUTHER <luther@d...>
Subject: Re: [Caml-list] currying...
On Tue, Mar 06, 2001 at 09:41:38AM -0800, Chris Hecker wrote:
> >This is pretty much how it works internally, although the precise
> >mechanisms used are slightly different in the bytecode interpreter and
> >in the native-code compiler.  Viewed from the outside, it maintains
> >the illusion that every function takes only one parameter,
> >and fun x y -> ... behaves like fun x -> (fun y -> ...).
> Okay, that makes sense, thanks.  Now my question is, is there any way to introspect to get at the arity information?  I think it must be stored somewhere at runtime, because I can pass both f's to another function because they have the same "illusory type".  
> Or do they?  Is int -> int -> int typechecked _exactly_ like int -> (int -> int)?  I assume they must be or the illusion wouldn't hold up.  I'd also assume this arity check only happens during application and doesn't affect typechecking at all.

Yes, they do, int -> int -> int is just an abreviation (or parenthesing
convention) of int -> (int -> int).


ven LUther
To unsubscribe, mail  Archives: