Commit f4f5a174 authored by Jan Stolarek's avatar Jan Stolarek
Browse files

Use primop wrappers instead of tagToEnum#

parent eb256640
......@@ -411,7 +411,7 @@ data STArray s i e
-- Just pointer equality on mutable arrays:
instance Eq (STArray s i e) where
STArray _ _ _ arr1# == STArray _ _ _ arr2# =
tagToEnum# (sameMutableArray# arr1# arr2#)
sameMutableArray arr1# arr2#
\end{code}
......
......@@ -676,7 +676,7 @@ data TVar a = TVar (TVar# RealWorld a)
INSTANCE_TYPEABLE1(TVar,tvarTc,"TVar")
instance Eq (TVar a) where
(TVar tvar1#) == (TVar tvar2#) = tagToEnum# (sameTVar# tvar1# tvar2#)
(TVar tvar1#) == (TVar tvar2#) = sameTVar tvar1# tvar2#
-- |Create a new TVar holding a value supplied
newTVar :: a -> STM (TVar a)
......
......@@ -45,7 +45,7 @@ as a a box, which may be empty or full.
-- pull in Eq (Mvar a) too, to avoid GHC.Conc being an orphan-instance module
instance Eq (MVar a) where
(MVar mvar1#) == (MVar mvar2#) = tagToEnum# (sameMVar# mvar1# mvar2#)
(MVar mvar1#) == (MVar mvar2#) = sameMVar mvar1# mvar2#
{-
M-Vars are rendezvous points for concurrent threads. They begin
......
......@@ -48,6 +48,6 @@ writeSTRef (STRef var#) val = ST $ \s1# ->
-- Just pointer equality on mutable references:
instance Eq (STRef s a) where
STRef v1# == STRef v2# = tagToEnum# (sameMutVar# v1# v2#)
STRef v1# == STRef v2# = sameMutVar v1# v2#
\end{code}
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