diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2018-11-10 01:12:52 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-03-22 10:34:51 -0400 |
commit | ab51bee40c82cd552bcf13e24b67d43f3b8d25f3 (patch) | |
tree | a75a4102576dad50af44e342fb9152e7270792eb /libraries/base/GHC/Base.hs | |
parent | cd07086ada34888c08585f4dc98a961618748ed0 (diff) | |
download | haskell-ab51bee40c82cd552bcf13e24b67d43f3b8d25f3.tar.gz |
base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail
Coauthored-by: Ben Gamari <ben@well-typed.com>
Diffstat (limited to 'libraries/base/GHC/Base.hs')
-rw-r--r-- | libraries/base/GHC/Base.hs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index 6b606d32ed..60a485c9bd 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -664,17 +664,6 @@ class Applicative m => Monad m where return :: a -> m a return = pure - -- | Fail with a message. This operation is not part of the - -- mathematical definition of a monad, but is invoked on pattern-match - -- failure in a @do@ expression. - -- - -- As part of the MonadFail proposal (MFP), this function is moved - -- to its own class 'Control.Monad.MonadFail' (see "Control.Monad.Fail" for - -- more details). The definition here will be removed in a future - -- release. - fail :: String -> m a - fail s = errorWithoutStackTrace s - {- Note [Recursive bindings for Applicative/Monad] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -855,8 +844,6 @@ instance Monad Maybe where (>>) = (*>) - fail _ = Nothing - -- ----------------------------------------------------------------------------- -- The Alternative class definition @@ -984,8 +971,6 @@ instance Monad [] where xs >>= f = [y | x <- xs, y <- f x] {-# INLINE (>>) #-} (>>) = (*>) - {-# INLINE fail #-} - fail _ = [] -- | @since 2.01 instance Alternative [] where @@ -1365,7 +1350,6 @@ instance Monad IO where {-# INLINE (>>=) #-} (>>) = (*>) (>>=) = bindIO - fail s = failIO s -- | @since 4.9.0.0 instance Alternative IO where |