You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+1 to promoting readMaybe.
HLint could replace read by fromMaybe undefined . readMaybe.
Partiality can be debugged better when it is in the application, rather
than in the library.
If not in the default hints, maybe there could be a hint set called something like "Expose partiality" that does this kind of transformation for most of the partial funtions in base/Prelude
The text was updated successfully, but these errors were encountered:
The only issue I have with this is that I doubt anyone would literally take that suggestion. At the very least they'd use error "..." rather than undefined.
If there's no single best suggested replacement for read, probably it should be a restricted function ({name: read, within: [], message "Use readMaybe"}) rather than a hint.
Have a special group of hints that people could enable is fine - that way the user makes a choice to opt in to partiality. I wish there was a todo = undefined in the stdlib, much like there is in Rust, that people could ban from being commited - that would ensure people did something sensible after.
See the thread at https://mail.haskell.org/pipermail/libraries/2021-October/031453.html, and in particular, the comment by @andreasabel (which I agree with) :
If not in the default hints, maybe there could be a hint set called something like "Expose partiality" that does this kind of transformation for most of the partial funtions in
base
/Prelude
The text was updated successfully, but these errors were encountered: