This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
Abilities tutorial: exercise answers for map, filter, take #267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
take
exercise was missing.map
andfilter
were only implemented in terms ofpipe
(which is a "very challenging" exercise) and therefore made the tutorial hard to follow, IMHO. So I added simpler implementations and renamed the existing ones.sum'
a bit up, reflecting the order of the exercises in the tutorial.I implemented the answers myself, hopefully in an idiomatic way. The function signatures in the base library slightly differ from the tutorial exercises and their implementation is not straightforward, so I did not use those.
I could not find any contribution guidelines... I just worked through the exercises and noticed the answers could be improved. If this PR is not very useful, feel free to reject it. I am also happy to receive feedback how to change it. Oh and I am not sure which branch to compare the PR against, is master correct?
Note that the solution for
take
usingpipe
is still missing. I couldn't come up with one. Very challenging indeed. ;) Otherwise an excellent, fun tutorial!