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

Open Beginner friendly
#433 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
elixir
Domain
tooling

Research direction

Search the repository for the quoted "best fitting Enum function" message and the total_quantity exercise guidance. Update the wording to say that Enum.reduce is for practice rather than the best-fitting function, and verify the resulting guidance matches the requested phrasing.

Written by the indexing model from the issue text.

Description

help wanted 🤝

Solution Implementation:

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".

Dominant language
Elixir
Stars
33
Forks
33
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/elixir-analyzer

All issues in exercism/elixir-analyzer

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.