-
Notifications
You must be signed in to change notification settings - Fork 634
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
[Umbrella] std/collections #1065
Comments
sounds good to me 👍🏼 |
I'm tempted to implement |
I would like to attempt implementing |
I would say just open the PR and if there are comments they will be posted there. Look at the ither functions for implementation and test reference, a lot can be copied as a template :-) |
do we really need average function? we can achieve this with a one-liner. array.reduce((a, b) => a + b) / array.length |
There is a PR for a separate math mofule that contains average together with other functions. A lot of things can be achieved with a one liner if you put enough things in a line, which does not necessarily mean that it is the most expressive, obvious, clear or often even known way to do it. See the math/statistics module PR for more info, |
I suggest that because we removed a lot of the proposed functions from the original PR. ref to this comment: #978 (comment) |
I would like to implement |
I would just add the pointer that including // Assuming some cli that expects exactly one argument
const target = single(Deno.args)
?? error("Expected exactly one argument")
doMagic(target) Also a note on the implementation: Make sure to short circuit when finding a second match instead of iterating through the rest of the array :-) |
We landed the initial version of
std/collections
at #993This issue is the umbrella issue for the remaining 28 APIs, which still need discussion. More detailed type definitions / docs / examples are available in the original proposal PR by @LionC.
ARRAYS
Transformations to Array
mapNotNullish
tocollections
#1103sortBy
function instd/collections
#1061withoutfeat(collections): Returns an array excluding single given value #1074Transformations to value
findLastIndex
function to std/collections #1060Number array transformations
averagemoved tostd/math
proposal feat(statistics): Implement mean, median, and mode. #1111Transformations to other formats
RECORDS
Predicates
Transformations to Records
deepMerge
#1075Groups
If you're interested in some specific items in the above, please pick one or more items, create a separate issue/PR for them, and keep discussion there.
The text was updated successfully, but these errors were encountered: