Fwd: Misleading documentation for `fail`

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Misleading documentation for `fail`

Artem Pelenitsyn
Hello,

The fail package [1] lists [hidden email] 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
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Misleading documentation for `fail`

Andreas Abel
 > 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 [hidden email]
> <mailto:[hidden email]> 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
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries