[commit: ghc] master: base: Add missing MonadFail instance for strict ST (4ec4ca9)

git at git.haskell.org git at git.haskell.org
Sun Sep 17 03:48:34 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4ec4ca999ac558e1678b0a609417de5bf08c3ad5/ghc

>---------------------------------------------------------------

commit 4ec4ca999ac558e1678b0a609417de5bf08c3ad5
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Sat Sep 16 23:47:37 2017 -0400

    base: Add missing MonadFail instance for strict ST
    
    Test Plan: Validate
    
    Reviewers: hvr, RyanGlScott, austin
    
    Reviewed By: RyanGlScott
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3982


>---------------------------------------------------------------

4ec4ca999ac558e1678b0a609417de5bf08c3ad5
 libraries/base/GHC/ST.hs    | 4 ++++
 libraries/base/changelog.md | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/libraries/base/GHC/ST.hs b/libraries/base/GHC/ST.hs
index 9f8bb64..7f3b4ff 100644
--- a/libraries/base/GHC/ST.hs
+++ b/libraries/base/GHC/ST.hs
@@ -78,6 +78,10 @@ instance Monad (ST s) where
         (k2 new_s) }})
 
 -- | @since 4.11.0.0
+instance Fail.MonadFail (ST s) where
+    fail s = errorWithoutStackTrace s
+
+-- | @since 4.11.0.0
 instance Semigroup a => Semigroup (ST s a) where
     (<>) = liftA2 (<>)
 
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 0ef5073..eac53ba 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -40,6 +40,8 @@
 
   * Add `Data` instances for `IntPtr` and `WordPtr` (#13115)
 
+  * Add missing `MonadFail` instance for `Control.Monad.Strict.ST.ST`
+
 ## 4.10.0.0 *April 2017*
   * Bundled with GHC *TBA*
 



More information about the ghc-commits mailing list