summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Base.hs
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2018-11-10 01:12:52 +0100
committerBen Gamari <ben@smart-cactus.org>2019-03-22 10:34:51 -0400
commitab51bee40c82cd552bcf13e24b67d43f3b8d25f3 (patch)
treea75a4102576dad50af44e342fb9152e7270792eb /libraries/base/GHC/Base.hs
parentcd07086ada34888c08585f4dc98a961618748ed0 (diff)
downloadhaskell-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.hs16
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