On Mon, Apr 16, 2012 at 11:42 AM, Geoffrey Irving <[email protected]> wrote:

> In a functional language
> it'd be nice to avoid polluting the type system with this distinction
> between function objects and functions.
>

Why? These things have the same type only because their types are
underspecified w.r.t. "constness".

If you said: the type system should preserve the ability to treat these
interchangeably where their compile-time constant-ness is not an issue,
then I wholly agree. That doesn't mean that they need to have the same type.


> In the case of sort, the advantage of passing in a function object
> instead of a closure transparent to the caller is that it allows the
> sort function to be partially evaluated without inlining it (if it's
> inlined everything is easy even with closures).  Is it feasible to
> hint to the compiler that we want certain things partially evaluated
> without polluting the type system?


Why is this polluting the type system? Where should this distinction be
expressed, if not in the type system?


Jonathan
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to