zlacker

[parent] [thread] 4 comments
1. titano+(OP)[view] [source] 2025-12-13 19:37:23
I don’t know gleam, but surely

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

   list.map(calculate_instruction)

?
replies(2): >>WJW+z >>tymsca+E
2. WJW+z[view] [source] 2025-12-13 19:40:23
>>titano+(OP)
That is correct.
3. tymsca+E[view] [source] 2025-12-13 19:40:53
>>titano+(OP)
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.
replies(1): >>Hasnep+CU
◧◩
4. Hasnep+CU[view] [source] [discussion] 2025-12-14 04:26:13
>>tymsca+E
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.
replies(1): >>pdimit+b61
◧◩◪
5. pdimit+b61[view] [source] [discussion] 2025-12-14 07:49:52
>>Hasnep+CU
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.
[go to top]