[Haskell-cafe] regex problem with ghc-8.6 and older

Ben Franksen ben.franksen at online.de
Sun May 28 22:11:33 UTC 2023

Thanks, this is helpful. It should have made me suspicious that I had to 
hide the fail from Prelude.

What happens here is that for ghc-8.6 and earlier the fail that is 
called by regex-tdfa is not the one from class MonadFail but the one 
from class Monad, even though the MonadFail class exists. And apparently 
newtype deriving will create an instance that calls error (either 
because the instance Monad for Either String does or because of a 
default definition).

So for ghc-8.6 and older I will have to write a bogus instance MonadFail 
(since makeRegexM requires it) and have to write out the Monad instance 


Am 28.05.23 um 22:53 schrieb Travis Cardwell via Haskell-Cafe:
> The `fail` method was part of the `Monad` type class from GHC 8.0
> (`base` ``) until GHC 8.6 (`base` ``).
> <https://hackage.haskell.org/package/base->
> It was removed from GHC 8.8 (`base` ``).
> <https://hackage.haskell.org/package/base->
> There is information about this in the MonadFail Proposal (MFP):
> <https://gitlab.haskell.org/haskell/prime/-/wikis/libraries/proposals/monad-fail>
> Cheers,
> Travis
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

I would rather have questions that cannot be answered, than answers that
cannot be questioned.  -- Richard Feynman

More information about the Haskell-Cafe mailing list