elm-format
elm-format copied to clipboard
Convert lambdas assigned directly to names to functions.
I did a few searches and couldn't find any previous discussion of this—apologies if I missed something.
I think it would be a good feature to rewrite lambdas assigned directly to names into normal function definitions.
E.g:
let
a =
(\b -> 1)
in
...
To:
let
a b =
1
in
...
I commonly find myself refactoring out lambdas from inline to names, and forgetting to make this change, which feels like it is always the preferable way to do this.
Something similar I see a fair bit is:
(\b -> someFunction b)
which could be replaced with
someFunction
I guess I'd wonder if this is likely to be an intermediate state for code that the developer might want to save without a reformat, so they can then make further changes to it.
Maybe this sort of changes is more suitable for elm-analyzer which would give users the choice