Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mikegehard opened this issue Aug 14, 2024 · 0 comments

Comments

@mikegehard
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant