[bitc-dev] Syntax: Quasi-curried application
Jonathan S. Shapiro
shap at eros-os.com
Tue Mar 10 00:16:20 EDT 2009
On Sun, Mar 8, 2009 at 2:22 PM, Dominique Quatravaux <domq at cpan.org> wrote:
> worth mentioning is that in OCaml, curry notation introduces some
> typing shenanigans that quite squarely violate the principle of least
> astonishment, see
> (although whether that particular problem also occurs in BitC's type
> system is miles beyond my understanding).
Because BitC doesn't have currying, the only way you can write that
example in BitC is to write the implied lambda explicitly:
(let ((map_id (lambda (l) (List.map (lambda (x) x) l))))
Somewhat perversely, the rewriting strategy that I had in mind would
operate by noticing that List.map was missing an argument, and
therefore auto-inserting this lambda. I had not considered the fact
that this rewrite changes the nature of the polymorphism by deferring
The moral of this story, such as it is, is that let-polymorphism is
full of surprises. This certainly isn't the only one.
But OK, I think I am now convinced that the most I should do in the
direction of currying is use a syntax that might easily admit it later
-- and perhaps I should not even do that much.
More information about the bitc-dev