[commit: ghc] master: Add Haddocks for Eq (STRef a) and Eq (IORef a) (0b89b2d)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 23:29:32 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0b89b2de8f67849a89e36bb4fcc03a47333627bf/ghc

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

commit 0b89b2de8f67849a89e36bb4fcc03a47333627bf
Author: Adam Sandberg Eriksson <adam at sandbergericsson.se>
Date:   Wed Jul 19 15:07:44 2017 -0400

    Add Haddocks for Eq (STRef a) and Eq (IORef a)
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: RyanGlScott, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3750


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

0b89b2de8f67849a89e36bb4fcc03a47333627bf
 libraries/base/GHC/IORef.hs | 9 ++++-----
 libraries/base/GHC/STRef.hs | 5 +++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libraries/base/GHC/IORef.hs b/libraries/base/GHC/IORef.hs
index 0736567..0832be0 100644
--- a/libraries/base/GHC/IORef.hs
+++ b/libraries/base/GHC/IORef.hs
@@ -31,11 +31,10 @@ import GHC.IO
 
 -- |A mutable variable in the 'IO' monad
 newtype IORef a = IORef (STRef RealWorld a)
-
--- explicit instance because Haddock can't figure out a derived one
--- | @since 4.1.0.0
-instance Eq (IORef a) where
-  IORef x == IORef y = x == y
+  deriving Eq
+  -- ^ Pointer equality.
+  --
+  -- @since 4.1.0.0
 
 -- |Build a new 'IORef'
 newIORef    :: a -> IO (IORef a)
diff --git a/libraries/base/GHC/STRef.hs b/libraries/base/GHC/STRef.hs
index 22db7f3..a6e4292 100644
--- a/libraries/base/GHC/STRef.hs
+++ b/libraries/base/GHC/STRef.hs
@@ -44,7 +44,8 @@ writeSTRef (STRef var#) val = ST $ \s1# ->
     case writeMutVar# var# val s1#      of { s2# ->
     (# s2#, () #) }
 
--- Just pointer equality on mutable references:
--- | @since 2.01
+-- | Pointer equality.
+--
+-- @since 2.01
 instance Eq (STRef s a) where
     STRef v1# == STRef v2# = isTrue# (sameMutVar# v1# v2#)



More information about the ghc-commits mailing list