X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FSTRef.lhs;h=9306b2473c8f0a2db7679d2a0c6b85faa319b062;hb=be2750a0a11b919fb03cc070074e430f88bdfa90;hp=5eecb85937a73927bead0d69640f8a336992b3cb;hpb=86a17d42a36c3272e993854b9bfa2276ae669324;p=ghc-base.git diff --git a/GHC/STRef.lhs b/GHC/STRef.lhs index 5eecb85..9306b24 100644 --- a/GHC/STRef.lhs +++ b/GHC/STRef.lhs @@ -1,5 +1,7 @@ \begin{code} -{-# OPTIONS -fno-implicit-prelude #-} +{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-} +{-# OPTIONS_HADDOCK hide #-} + ----------------------------------------------------------------------------- -- | -- Module : GHC.STRef @@ -14,6 +16,7 @@ -- ----------------------------------------------------------------------------- +-- #hide module GHC.STRef where import GHC.ST @@ -39,10 +42,6 @@ writeSTRef (STRef var#) val = ST $ \s1# -> case writeMutVar# var# val s1# of { s2# -> (# s2#, () #) } --- |Mutate the contents of an 'STRef' -modifySTRef :: STRef s a -> (a -> a) -> ST s () -modifySTRef ref f = readSTRef ref >>= writeSTRef ref . f - -- Just pointer equality on mutable references: instance Eq (STRef s a) where STRef v1# == STRef v2# = sameMutVar# v1# v2#