Closed safinaskar closed 5 years ago
I'm not a fan of such overlapping instances.
I'm also not sure there should be something considered "the right way" to report errors.
I'm against this.
In GHC 8.8.1, fail
will be rebindable to allow any IsString
. So this idea becomes even worse IMO.
Closing. If anyone thinks this would be useful, feel free to re-open/ping to re-open.
Currently there is no relation between MonadFail and MonadError. And this is bad.
What is the right way to report errors if you know that they are strings and you want to be able to catch them in pure code? Currently we have such options: Either String, MonadFail and MonadError. Either String is not very general, so we have MonadFail and MonadError. Unfortunately, they are incompatible in both ways! What to do? Well, I propose creating instance
instance (MonadError String a) => MonadFail a