Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDict.first, Dict.last, Set.first, Set.last #844
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Mar 15, 2017
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Mar 15, 2017
|
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Skinney
May 9, 2017
Contributor
You'll have more luck trying to add this to elm-community/dict-extra.
|
You'll have more luck trying to add this to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
billstclair
May 9, 2017
@Skinney I currently use in my code an implementation based on Set.toList and Dict.toList. The purpose of this patch is to make that faster with no memory allocation by using the internals of the opaque Set and Dict types. That can't be done in elm-community/dict-extra.
billstclair
commented
May 9, 2017
|
@Skinney I currently use in my code an implementation based on Set.toList and Dict.toList. The purpose of this patch is to make that faster with no memory allocation by using the internals of the opaque Set and Dict types. That can't be done in |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
myrho
Oct 10, 2017
+1
The elm-community/intdict also has this already. It's called findMin and findMax there.
myrho
commented
Oct 10, 2017
|
+1 The |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 7, 2018
Member
At some point we will do a review of the *-extras and bring things in. These seem like good candidates because of their asymptotics, but there are other Dict changes that mean it will be easier to just do the changes by hand, rather than through PR.
|
At some point we will do a review of the |
billstclair commentedMar 15, 2017
I have an application that needs to process the elements of a Set one at a time. Currently, the only way to get an element from a set is to convert it to a list and take an element of the list. It's quicker and conses less to just get the first or last element out of the internal storage, and use that.
Since Set is based on Dict, I added first and last to both.
My current code:
With these changes: