jfmengels / elm-review-simplify

Provides elm-review rules to simplify your Elm code
https://package.elm-lang.org/packages/jfmengels/elm-review-simplify/latest/
BSD 3-Clause "New" or "Revised" License
19 stars 9 forks source link

Various performance speedups #93

Closed jfmengels closed 1 year ago

jfmengels commented 1 year ago

Can be reviewed commit by commit.

I can remove a few of these if you think that it makes it really hard to read, let me know what you think!

jfmengels commented 1 year ago

I bet there is a middle ground somewhere that doesn't downgrade readability this much, like having setMapFromList, dictMapFromList etc. but since you removed RangeDict.mapFromList I take it that you dislike this?

I think so as well, I'm thinking about adding functions like these and maybe making that into a package, who knows. I'm not against this, but often the function will also need to take a initial value. My gut feeling is that these might end up complex enough that an inline fold might be easier, but it's worth looking into.

Maybe I should re-add RangeDict.mapFromList, what do you think? I was initially hoping for more changes, that would have required this inlining, but decided to hold back on those, at least for now, so maybe I should?

jfmengels commented 1 year ago

I've re-added RangeDict.mapFromList