5 ms·
I don't have it in front of me but I would assume the FromJSON instance for Float expects a JSON number, not a string. If the remote API makes the (puzzling) de
by thinkpad20 9y ago
I don't have it in front of me but I would assume the FromJSON instance for Float expects a JSON number, not a string. If the remote API makes the (puzzling) decision to put numeric values in strings, then parsing those will be necessary. Although, I agree that the 'read' function is the wrong one to use here, due to it making the function partial (consider 'readMaybe' instead?)
- aviaviavi 9y agoIt does indeed do that, there are numeric values returned as strings (i have _no_ idea why they do that), which is why I had `read` in there. I didnt know about readMaybe though, I'll definitely do that, thanks!