Wolfgang Jeltsch pushed to branch wip/jeltsch/base-buildable-with-ghc-9-14 at Glasgow Haskell Compiler / GHC
Commits:
-
011148d6
by Wolfgang Jeltsch at 2026-05-19T13:47:14+03:00
1 changed file:
Changes:
| 1 | +{-# LANGUAGE CPP #-}
|
|
| 1 | 2 | {-# LANGUAGE Safe #-}
|
| 2 | 3 | |
| 3 | 4 | -- |
|
| ... | ... | @@ -63,6 +64,9 @@ module Control.Monad |
| 63 | 64 | ) where
|
| 64 | 65 | |
| 65 | 66 | import GHC.Internal.Control.Monad
|
| 67 | +#if __GLASGOW_HASKELL__ < 1000
|
|
| 68 | +import Data.Function (const)
|
|
| 69 | +#endif
|
|
| 66 | 70 | |
| 67 | 71 | {- $naming
|
| 68 | 72 | |
| ... | ... | @@ -88,3 +92,18 @@ The functions in this module use the following naming conventions: |
| 88 | 92 | > mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
|
| 89 | 93 | |
| 90 | 94 | -}
|
| 95 | + |
|
| 96 | +#if __GLASGOW_HASKELL__ < 1000
|
|
| 97 | + |
|
| 98 | +-- | Sequence two monadic actions, discarding the result of the first one.
|
|
| 99 | +--
|
|
| 100 | +-- Defined as `thenM ma mb = ma >>= const mb`.
|
|
| 101 | +--
|
|
| 102 | +-- This can be used to define `(*>) = thenM`.
|
|
| 103 | +--
|
|
| 104 | +-- @since 4.23.0.0
|
|
| 105 | +thenM :: (Monad m) => m a -> m b -> m b
|
|
| 106 | +thenM ma mb = ma >>= const mb
|
|
| 107 | +{-# INLINEABLE thenM #-}
|
|
| 108 | + |
|
| 109 | +#endif |