diff options
author | Tom Ellis <tom-git@jaguarpaw.co.uk> | 2022-04-17 10:49:36 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-05 12:48:09 -0400 |
commit | 7da90ae34bda878f201da040799498ca873b356b (patch) | |
tree | 7e813db5643a84af3ca1d0b07fd27712fc4b2e11 /libraries | |
parent | f050557eba193f92d818de7c9fc261af595173d0 (diff) | |
download | haskell-7da90ae34bda878f201da040799498ca873b356b.tar.gz |
Explain that 'fail s' should run in the monad itself
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/base/Control/Monad/Fail.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libraries/base/Control/Monad/Fail.hs b/libraries/base/Control/Monad/Fail.hs index 3d7da77134..fcc6d1920b 100644 --- a/libraries/base/Control/Monad/Fail.hs +++ b/libraries/base/Control/Monad/Fail.hs @@ -61,6 +61,10 @@ import GHC.Base (String, Monad(), Maybe(Nothing), IO(), failIO) -- fail _ = mzero -- @ -- +-- @fail s@ should be an action that runs in the monad itself, not an +-- exception (except in instances of @MonadIO@). In particular, +-- @fail@ should not be implemented in terms of @error@. +-- -- @since 4.9.0.0 class Monad m => MonadFail m where fail :: String -> m a |