[Haskell-cafe] MonadFail with type parameter for error message

Daneel Yaitskov dyaitskov at gmail.com
Tue Nov 30 19:16:14 UTC 2021

Dear Cafe,

MonadFail.fail takes String.
I wasn't able to find MonadFail for custom error type.
Is there any proposals to base?

Let's say Data.Text, which gains popularity with OverloadedStrings

class MonadFail m where
  fail :: String -> m a

Why not ?
class MonadFail m where
  fail :: (forall s. IsString s => s) -> m a

class MonadFailWith m s where
  fail :: s -> m a


Best regards,
Daniil Iaitskov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20211130/ec018de2/attachment.html>

More information about the Haskell-Cafe mailing list