Fable: Rename CurriedLambda to Curry

Created on 6 Jan 2018  路  5Comments  路  Source: fable-compiler/Fable

Change for Fable 1.4, now that CurriedLambda is applied in more places this should make for more readable code.

Most helpful comment

CurriedFSharpFunction must be really delicious :yum:

All 5 comments

Isn't Curry a little bit too abstract? People new to FP might think of food :curry: :smile:

This is only for the generated code, users won't have to type the name directly ;)

users won't have to type the name directly

Yes, but people will probably want to actually read the generated code, and I think that "Curry" is pretty abstract, even from an FP point of view.

Have you considered FSharpFunction? Or any variation of it, like FSFunction or FSharpF?

CurriedFSharpFunction must be really delicious :yum:

Hmm, FSharpFunction won't probably work. Fable 1.x by default flattens curried lambda into multi-arg lambdas, and adds ad-hoc wrapping when less arguments than expected are applied. Only in the cases where Fable is unable to resolve arity at compile-time, it wraps the function with CurriedLambda basically deferring arity check to runtime.

However this is an implementation detail the average user shouldn't be too bothered with IMHO. That's why I'd prefer the operator is shorter and doesn't stand out too much in generated code. Users that really want to understand what's going on will probably have to go to fable-core source and check it. This is the same for other operators (e.g. createAtom) so I'm not sure the situation will improve much by giving a more meaningful name to this operator (which should be something like DynamicallyCurried).

BTW, in most Fable apps Wepback _obfuscates_ the code enough so users won't realize the difference. This is mostly thinking in the Fable REPL.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theprash picture theprash  路  3Comments

MangelMaxime picture MangelMaxime  路  3Comments

MangelMaxime picture MangelMaxime  路  3Comments

stkb picture stkb  路  3Comments

et1975 picture et1975  路  3Comments