summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/ST.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/ST.hs')
-rw-r--r--libraries/base/GHC/ST.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/base/GHC/ST.hs b/libraries/base/GHC/ST.hs
index 4e00c0e85f..a245b9fc50 100644
--- a/libraries/base/GHC/ST.hs
+++ b/libraries/base/GHC/ST.hs
@@ -77,6 +77,11 @@ instance Monad (ST s) where
case (k r) of { ST k2 ->
(k2 new_s) }})
+-- | @since 4.11.0.0
+instance Monoid a => Monoid (ST s a) where
+ mempty = pure mempty
+ mappend = liftA2 mappend
+
data STret s a = STret (State# s) a
-- liftST is useful when we want a lifted result from an ST computation. See