Commit 0b89b2de authored by Adam Sandberg Eriksson's avatar Adam Sandberg Eriksson Committed by Ben Gamari
Browse files

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
parent 1ed41a74
......@@ -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)
......
......@@ -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#)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment