Skip to content

removes an elixir specific clause that is not necessary #274

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

Merged
merged 1 commit into from
Jun 21, 2016

Conversation

jedschneider
Copy link
Contributor

As shown in the example solution it can be done in Elixir without using a named module, like Enum.reduce. In fact its probably confusing to suggest so.

@Cohen-Carlisle
Copy link
Member

I don't think this should be removed without substantial input from @exercism/elixir as not allowing Enum.reduce may make the problem a lot harder.
It may also be the case that since reduce was implemented in the list-ops exercise, the library function is allowed as we don't want to make them reinvent the wheel/copy and paste.
There has also been some talk of language specific add-ons to the README... if that's ready then this could go ahead and any message could be moved to there.

@NobbZ
Copy link
Member

NobbZ commented Jun 17, 2016

I dont think, that the exercise will be harder by forbidding Enum.reduce.
As I have realized during Haskell classes, most people seem to find it very
hard to write this exercises function in terms of reducing/folding the list
instead of simply following the apply-cons-recurse-pattern.

Also I do think, if we leave Elixirs Enum.reduce in there and mention it,
why don't we take Haskells folds, Rubys Enum.reduce/inject and all
the other languages as well into this list? As it is now, it seems a little
bit like using a fold is fine in elixir but forbidden on all the other
tracks, while I do personally think that it is an important step for a
learner to get from apply-cons-recurse to a higher order fold.

Cohen Carlisle [email protected] schrieb am Fr., 17. Juni 2016
03:18:

I don't think this should be removed without substantial input from
@exercism/elixir https://github.com/orgs/exercism/teams/elixir as not
allowing Enum.reduce may make the problem a lot harder.
It may also be the case that since reduce was implemented in the list-ops
exercise, the library function is allowed as we don't want to make them
reinvent the wheel/copy and paste.
There has also been some talk of language specific add-ons to the
README... if that's ready then this could go ahead and any message could be
moved to there.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#274 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADmR91-Vo5dwMZSZexntWFcTKJhC5lCks5qMfXxgaJpZM4I36oh
.

@jedschneider
Copy link
Contributor Author

I agree with @NobbZ, which is why I offer the edit. It seems silly to make an exemption for Elixir specifically when the problem is not really a problem that lends itself to reduction over list construction (cons) and Elixir supports that in its core language functionality. No copy and paste from list-ops is necessary. As a side note, the order of the exercises in the elixir module seem out of order, with the accumulate being an exercise that would be excellent way to introduce recursion earlier in the challenge set. IMHO the bracket push, and sublist problems were much harder and would benefit from more recursion and cons practice highlighted by this exercise.

@parkerl
Copy link
Contributor

parkerl commented Jun 21, 2016

👍

I don't think this adds to the difficulty of the exercise. I think it is actually helpful to reinforce that Enum.reduce at its simplest is head/tail recursion like reduce([h | t], acc, fun) and reduce([], acc, _fun).

@Cohen-Carlisle Cohen-Carlisle merged commit b89aec5 into exercism:master Jun 21, 2016
ijanos pushed a commit to exercism/rust that referenced this pull request Sep 1, 2017
Elixir-specific portion added:
exercism/exercism#1136

Lisp-specific portion added:
exercism/problem-specifications#98

Elixir-specific portion removed because the `Enum.reduce` was not
necessary:
exercism/problem-specifications#274

It doesn't seem to make much sense to include this Lisp-specific
sentence in non-Lisp tracks.

exercism/problem-specifications#871
petertseng added a commit to exercism/haskell that referenced this pull request Sep 8, 2017
Elixir-specific portion added:
exercism/exercism#1136

Lisp-specific portion added:
exercism/problem-specifications#98

Elixir-specific portion removed because the `Enum.reduce` was not
necessary:
exercism/problem-specifications#274

It doesn't seem to make much sense to include this Lisp-specific
sentence in non-Lisp tracks.

exercism/problem-specifications#871
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

Successfully merging this pull request may close these issues.

4 participants