Closed jfmengels closed 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?
I've re-added RangeDict.mapFromList
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!