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-01 22:51:16 -0500 |
commit | 957edc8337ccb9d761af393cf61adc80190bc374 (patch) | |
tree | 7a6022874d07025457f9e90aeba956db9009cdc5 /libraries/base/GHC/Base.hs | |
parent | b1c7ffafc64c5e04fe59e1c38fe86693de3498aa (diff) | |
download | haskell-957edc8337ccb9d761af393cf61adc80190bc374.tar.gz |
base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail
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 |