|
|
|
|
|
by pyrale
22 days ago
|
|
It is that even without an open typeclass system, these specific typeclasses have been a common request for a long while. I have worked at a few elm places, there is always a dict-for-everything dependency or local implementation. |
|
But I agree with you that the current solutions for Set/Dict all have one problem or another: You can use elm-sorter-experiment [1] but then you are writing a sort function and passing it around and maybe you don't want the overhead of that. You can switch to the Lamdera compiler and use containers [2] but then it's a different compiler and a you need to tweak your options slightly to compile an Elm project as an Elm project in it and it could get out of sync with the Elm compiler (extremely unlikely though). You can use any of the list/dict implementations that are really just lists with O(n) everything under the hood. So maybe this hashable type is going to make things better, idk.
[0] https://github.com/elm/compiler/issues/774#issuecomment-3472...
[1] https://github.com/rtfeldman/elm-sorter-experiment
[2] https://github.com/lamdera/containers/tree/main