On 23 February 2015 at 20:40, Jonathan S. Shapiro <[email protected]> wrote:
> On Mon, Feb 23, 2015 at 11:13 AM, Keean Schupke <[email protected]> wrote: > > If I define: >> >> def f x = \y . x + y >> >> and I can then use this as: >> >> ((f 1) 2 >> >> All I am suggesting is that you can write this: >> >> (f 1 2) >> >> And have the compiler 'specialise' the call to: >> >> ((f 1) 2) >> > > I agree. I'm not quite sure what I was thinking about. > So the alternative (optimisation) is to take (f 1 2) and 'specialise' the definition to: def f x y = x + y Which can be done with access to the definition by removing the lambda. So given a function with arity (1,1) and which is applied like an arity (2) function there are two ways to specialise, one is just to "correct" the application, the other to remove lambda's from the definition. Then you can define the order on function types which expresses this relation in the type system. Keean.
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
