Open CrowdHailer opened 4 years ago
This isn't a function I've used before- is there precedence in other languages' standard libraries? What's the use case?
The usecase is in http query strings being able to show a user an error for parameters that shouldn't be declared twice but where
I've had a look around but I can't find any existing languages with this function- do you know of any?
No, but I my experience most applications don't actually show duplicate keys as a warning. so at some level it is missing. Quite happy for this to be something that lives in my parameters library for a while
Let's keep it there for now, and we can promote it if it turns out to be commonly useful.
A function that will turn a list to a map or return an error if a duplicate key is found.
Returned error value is the first key