úÎAÜ?02      !"#$%&'()*+,-./01  See Control.Concurrent.MVar.putMVar See  Control.Concurrent.MVar.takeMVar See Control.Concurrent.MVar.newMVar See $Control.Concurrent.MVar.newEmptyMVar      The  and Data.MRef.Classes.DefaultMRef are used to K internally constrain types that do not escape an expression, so that the L compiler may choose an instance for the reference type (which it otherwise D would not, and maybe not even tell you until you tried to use your 0 function). For an example, see the source for Data.StateRef.newCounter.  See also Data.MRef.Classes.DefaultMRef. "The sole purpose for these classes'" existence is as a carrier for an G altered set of functional dependencies, which constrain the reference E type to be uniquely determined by the monad and the contained type. 8Atomically modify the contents of a reference. This is > implemented in a separate class (rather than a function with < context (ReadRef sr m a, WriteRef sr m a)) because in most 9 cases the default implementation cannot act atomically. Same thing, but don'.t thread out the extra return. Could perhaps / be implemented slightly more efficiently than  in many cases. J Note that implementations are expected to be atomic, if at all possible, " but not strictly required to be. ?Get the current value referenced by the given state reference. KReplace the existing value of the given reference with the provided value. AConstruct a new mutable reference containing the provided value.    DWrap a state reference that supports reading and writing, and add a  potentially thread-unsafe  instance.     !"#$% !"#$%$%"# ! !!"##$%%&KCreate a reference and constrain its type to be the default reference type 2 for the monad in which it is being created. See . 'IRead a reference and constrain its type to be the default reference type / for the monad in which it is being read. See . (JWrite a reference and constrain its type to be the default reference type 2 for the monad in which it is being written. See  )KModify a reference and constrain its type to be the default reference type 3 for the monad in which it is being modified. See . *KModify a reference and constrain its type to be the default reference type 3 for the monad in which it is being modified. See . + Essentially the same concept as Control.Monad.State.gets,  Control.Monad.State.asks-, et al. Typically useful to read a field of G a referenced ADT by passing a record selector as the second argument. ,=Construct a counter - a monadic value which, each time it is  evaluated, returns the 2! of the previous value returned. - Create a " lapse reader"/ (suggestions for better terminology are more D than welcome), a sort of a time-lapse of the variable. The first K motivating instance for this operation was a clock in a simple simulation  application. Given a  3 called "clock" , a useful  value "dT" is yielded by the expression: - clock (-) note that there'!s a unification ghc missed here: I the fundep sr -> a on NewRef and DefaultStateRef should cause a and a1 . to be unified, because of the 2 constraints:  NewRef sr1 m a  DefaultStateRef sr1 m1 a1  this isn't a "bug"4 because the type is still valid, but it seems like  something ghc "ought"1 to do, since a and a1 are doomed to unification  anyway. &  !"#$%&'()*+,-&'()*+,-&'()*+,-      .HCreate a m-reference and constrain its type to be the default reference 7 type for the monad in which it is being created. See . /ECreate an empty m-reference and constrain its type to be the default A reference type for the monad in which it is being created. See . 0See . 1See .  ./01./01./014   !"#$%&'()*+,-./01234566778899:;<=>?@ABCDEFG HIJstateref-0.2.1.1Data.StateRef.InstancesData.MRef.ClassesData.StateRef.Classes Data.Accessor Data.StateRef Data.MRefData.StateRef.Instances.STM#Data.StateRef.Instances.UndecidableData.MRef.Instances.STMData.MRef.Instancesghc-primGHC.Prim RealWorldbaseGHC.ForeignPtr ForeignPtrGHC.STSTGHC.Conc atomicallySTMTVar GHC.IORefIORef GHC.STRefSTRefGHC.MVarMVar mtl-1.1.1.0Control.Monad.TransliftIOMonadIO stm-2.1.2.2Control.Concurrent.STM.TMVarTMVar DefaultMRefPutMRefputMRefTakeMReftakeMRefNewMRefnewMRef newEmptyMRefDefaultStateRef ModifyRefatomicModifyRef modifyRefReadRefreadRefWriteRefwriteRefNewRefnewRefUnsafeModifyRefAccessorSetterGetter newDefaultRefreadDefaultRefwriteDefaultRefatomicModifyDefaultRefmodifyDefaultRefreadsRef newCounter mkLapseReadernewDefaultMRefnewDefaultEmptyMReftakeDefaultMRefputDefaultMRefGHC.Enumsucc GHC.TypesDouble