[commit: stm] master: Change the type of check to Bool -> STM () (0f5a7de)

Simon Marlow marlowsd at gmail.com
Fri Jul 6 17:52:35 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/packages/stm

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0f5a7de30b4158b4a7e1ece7651728994d17850d

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

commit 0f5a7de30b4158b4a7e1ece7651728994d17850d
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Jul 5 14:51:43 2012 +0100

    Change the type of check to Bool -> STM ()
    
    Previously it was
    
      check :: Bool -> STM a
    
    and it returned undefined when passed True.  This doesn't seem useful,
    and causes GHC to warn about an unused result.
    
    (suggestion by Favonia <favonia at gmail.com> on libraries at haskell.org)

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

 Control/Monad/STM.hs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Control/Monad/STM.hs b/Control/Monad/STM.hs
index 44bb345..0bcd791 100644
--- a/Control/Monad/STM.hs
+++ b/Control/Monad/STM.hs
@@ -62,8 +62,8 @@ instance MonadPlus STM where
   mplus = orElse
 #endif
 
-check :: Bool -> STM a
-check b = if b then return undefined else retry
+check :: Bool -> STM ()
+check b = if b then return () else retry
 #endif
 
 #if ! (MIN_VERSION_base(4,3,0))





More information about the Cvs-libraries mailing list