While working in Elm, I came across the problem of updating records that had similar fields but I had to write a function for each type due to lack of type classes.
Lets say we have the following two records defined in our app and we want to
update the error field in both these records with a String
type.
Before I found this trick, I had to write two functions, one for each record.
The solution was hidden in Richard Feldman’s amazing open source application.
Great, isn’t it. I just love Elm, even with all its shortcomings :)