exercism / exercism/elixir-analyzer

Is Enum.reduce the "best fitting Enum function" for total_quantity in `boutique-inventory`?

未關閉
#433 2 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視
help wanted 🤝
主要語言
Elixir
星號
33
分支
33
PR 合併指標
30 天內沒有已合併 PR

描述

Solution Implementation:

```elixir
def total_quantity(item) do
Map.values(item.quantity_by_size)
|> Enum.sum()
end

```

The solution says:
image

I agree that `reduce` is a good function/concept to practice with for this solution but "best fitting" seems like a stretch. It took me a long time to understand the concept of `reduce` when learning functional programming and this may be a head scratcher for some folks new to Elixir and functional programming togther.

Would it be possible to change that message to say "Use the Enum.reduce function in the total_quantity function to practice."?

This doesn't give folks who can't figure out `reduce` right away the feeling like they are doing it "wrong".

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。