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

Functions that need to implement #7

Open
atlas-comstock opened this issue May 23, 2020 · 0 comments
Open

Functions that need to implement #7

atlas-comstock opened this issue May 23, 2020 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@atlas-comstock
Copy link
Member

atlas-comstock commented May 23, 2020

find(enumerable, default \\ nil, fun)
Returns the first element for which fun returns a truthy value. If no such element is found, returns default.


map(enumerable, fun)
Returns a list where each element is the result of invoking fun on each corresponding element of enumerable.

reduce(enumerable, fun)
Invokes fun for each element in the enumerable with the accumulator.
reduce(enumerable, acc, fun)
Invokes fun for each element in the enumerable with the accumulator.

sum(enumerable)
Returns the sum of all elements.

ll?(enumerable, fun \\ fn x -> x end)
Returns true if fun.(element) is truthy for all elements in enumerable.

any?(enumerable, fun \\ fn x -> x end)
Returns true if fun.(element) is truthy for at least one element in enumerable.

uniq(enumerable)
Enumerates the enumerable, removing all duplicated elements.
uniq_by(enumerable, fun)
Enumerates the enumerable, by removing the elements for which function fun returned duplicate elements.

具体可以看:https://hexdocs.pm/elixir/Enum.html

项目是对标这个来做的,选了我认为用得比较高频率的函数

@atlas-comstock atlas-comstock added the help wanted Extra attention is needed label May 23, 2020
@atlas-comstock atlas-comstock pinned this issue May 23, 2020
@z2z23n0 z2z23n0 mentioned this issue Jun 18, 2020
@z2z23n0 z2z23n0 unpinned this issue Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant