
I ran into a scenario where the use of MonadError would only be valid if catchError (pure a) h = pure a was a law, so I looked up the laws in https://hackage.haskell.org/package/mtl-2.3/docs/Control-Monad-Error-Class.h... but surprisingly found none. One would expect to see 1. catchError (pure a) h = pure a 2. catchError (throwError e) h = h e 3. throwError e >>= f = throwError e which would rule out silly instances like instance MonadError () Maybe where throwError () = Nothing catchError _ f = f () Searching for "monad error laws" gives me no haskell results, only https://typelevel.org/blog/2018/04/13/rethinking-monaderror.html which suggests the same laws. I propose adding these 3 laws to MonadError haddocks. AFAICT the IO/Maybe/Either/ExceptT instances in https://hackage.haskell.org/package/mtl-2.3/docs/src/Control.Monad.Error.Cla... all obey the laws.