Fwd: Misleading documentation for `fail`

Hello, The fail package [1] lists libraries@haskell.org as maintainer's address, so I'm writing here. The documentation for the single module in the package claims: This module can be imported for defining forward compatible MonadFail instances: import qualified Control.Monad.Fail as Fail instance Monad Foo where (>>=) = {- ...bind impl... -} -- Provide legacy fail implementation for when -- new-style MonadFail desugaring is not enabled. fail = Fail.fail ... But defining the fail method inside a Monad instance will produce an error on GHC 8.8+. Should this bit be removed? -- Best, Artem [1]: http://hackage.haskell.org/package/fail

error on GHC 8.8+. Should this bit be removed?
I'd say it should be put under a suitable #if conditional. (For the sake of developers who wish to support many GHC versions.) On 2020-02-07 03:47, Artem Pelenitsyn wrote:
Hello,
The fail package [1] lists libraries@haskell.org mailto:libraries@haskell.org as maintainer's address, so I'm writing here. The documentation for the single module in the package claims:
This module can be imported for defining forward compatible MonadFail instances:
import qualified Control.Monad.Fail as Fail
instance Monad Foo where (>>=) = {- ...bind impl... -}
-- Provide legacy fail implementation for when -- new-style MonadFail desugaring is not enabled. fail = Fail.fail ...
But defining the fail method inside a Monad instance will produce an error on GHC 8.8+. Should this bit be removed?
-- Best, Artem
[1]: http://hackage.haskell.org/package/fail
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
participants (2)
-
Andreas Abel
-
Artem Pelenitsyn