Open
Description
Hi !
I really like the formatter, but there’s some cases where I wonder if it’s by design or not.
I wonder mainly about curried functions. I’m coming mainly from functional programming (Haskell and stuff) and it’s usual to have something like this:
// In JavaScript for example
const fun = arg1 => arg2 => arg3 => {
// body...
}
// In Dart for example
fun(arg1) => (arg2) => (arg3) {
// body...
};
But when doing the latter, it’s indented like this:
fun(arg1) => (arg2) => (arg3) {
final var = 1;
return var;
};
It feels like there’s two unneeded spaces in the function body. With indent guides and other stuff, it renders strangely. Is it on purpose or because of some rules on closures? I know we can do it differently, like:
fun(arg1, arg2, arg3) {}
// And then use a closure at the appropriate place
onEvent: (event) => fun('fromScope', 'alsoFromScope', event);
// Instead of:
fun(arg1, arg2) => (arg3) {};
// And then
onEvent: fun('fromScope', 'alsoFromScope');
It’s a similar result in the end, but it’s a slightly different code.
What do you think about this?