Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don’t know gleam, but surely

    list.map(fn(line) { line |> calculate_instruction })
Could be written

   list.map(calculate_instruction)

?




You're right, but loads of times I just left that there because I probably did something more involved in the map that I ended up deleting later without realising.

This sounds like the kind of situation where the LSP could suggest the simpler code, I'll see if there's an issue for it already and suggest it if not.

Elixir has one opinionated formatter -- Quokka -- that will rewrite the code above properly. It can also reuse linting rules as rewrite policies. Love using it.

That is correct.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: