4-8      !"#$%&'()*+,-./01234567  Safe-Inferred See  See   See   See          Safe-Inferred iConstruct a new mutable reference (of an unspecified implementation type) containing the provided value. 1Construct a new reference to the provided value. 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. !JA simple reference type, hiding the complexity of all these type classes, T since most of the time the only thing you care about is that you want a reference. R The full complexity is still there, though, so FFI types or other reference-like  things can still be made into !s. #]Default implementation of atomicModifyReference in terms of readReference and writeReference $WDefault implementation of modifyReference in terms of readReference and writeReference  !"#$ !"#$!" #$ !"#$  Safe-Inferred89:;<=>?@ABCDEFGHIJ 89:;<=>?@ABCDEFGHIJ  Safe-Inferred'DWrap a state reference that supports reading and writing, and add a  potentially thread-unsafe  instance. '(KLM'('(KLMNone!NOPQRSTUVWXYZ[\]^_`abcdefghijklmn %&'(&% '(!NOPQRSTUVWXYZ[\]^_`abcdefghijklmn Safe-Inferred )*+,-.opqr)*+,-.-.+,)*)*+,-.opqrNone/Read a !. See . 0Write a !. See   1 Modify a !. See . 2 Modify a !. See . 3 Essentially the same concept as ,  -, et al. Typically useful to read a field of G a referenced ADT by passing a record selector as the second argument. 4=Construct a counter - a monadic value which, each time it is  evaluated, returns the s! of the previous value returned. 5 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  t called "clock" , a useful  value "dT" is yielded by the expression: 5 clock (-) /012345*  !"#$%&'()*+,-./012345/012345/012345Noneuvwxyz{|}~ uvwxyz{|}~None %&&% None6See 6. 7See 7. 67 %&676767 !"#$%&'()*+,-./01223456789:;<=>>?@ABCABD E EFFGGHHIJKLMNOPQ R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f ghijklmnopqrstuvwxyz{|}~VWXY stateref-0.3Data.StateRef.InstancesData.MRef.TypesData.StateRef.Types Data.Accessor Data.StateRef Data.MRefControl.Concurrent.MVarputMVartakeMVarnewMVar newEmptyMVarData.StateRef.Instances.STM#Data.StateRef.Instances.UndecidableControl.Monad.StategetsasksData.MRef.Instances.STMData.MRef.Instancesghc-primGHC.Prim RealWorldbaseGHC.ForeignPtr ForeignPtrGHC.STST GHC.Conc.Sync atomicallySTMTVar GHC.IORefIORef GHC.STRefSTRefGHC.MVarMVar stm-2.4.2Control.Concurrent.STM.TMVarTMVarPutMRef putMReferenceTakeMReftakeMReferenceNewMRef newMReferencenewEmptyMReferenceHasMRefnewMRef newEmptyMRefMRefHasRefnewRefNewRef newReference ModifyRefatomicModifyReferencemodifyReferenceReadRef readReferenceWriteRefwriteReferenceRefdefaultAtomicModifyReferencedefaultModifyReferencetransformers-0.3.0.0Control.Monad.IO.ClassliftIOMonadIOUnsafeModifyRefAccessorSetterGetterreadRefwriteRefatomicModifyRef modifyRefreadsRef newCounter mkLapseReadertakeMRefputMRef$fReadRefTMVarmMaybe$fNewRefTMVarmMaybe$fReadRefTMVarSTMMaybe$fNewRefTMVarSTMMaybe$fModifyRefRefma$fWriteRefRefma$fReadRefRefma $fNewRefRefma$fModifyRefTVarma$fWriteRefTVarma$fReadRefTVarma$fNewRefTVarma$fModifyRefTVarSTMa$fWriteRefTVarSTMa$fReadRefTVarSTMa$fNewRefTVarSTMa $fHasRefSTM$fReadRefSTMma$fReadRefSTMSTMa$fModifyRefUnsafeModifyRefma$fWriteRefUnsafeModifyRefma$fReadRefUnsafeModifyRefma$fModifyRefForeignPtrma$fWriteRefForeignPtrma$fReadRefForeignPtrma$fNewRefForeignPtrma$fNewRefMVarmMaybe$fModifyRefSTRefSTa$fWriteRefSTRefSTa$fReadRefSTRefSTa$fNewRefSTRefSTa $fHasRefST$fModifyRefSTRefIOa$fWriteRefSTRefIOa$fReadRefSTRefIOa$fNewRefSTRefIOa$fModifyRefSTRefSTa0$fWriteRefSTRefSTa0$fReadRefSTRefSTa0$fNewRefSTRefSTa0 $fHasRefST0$fModifyRefIORefma$fWriteRefIORefma$fReadRefIORefma$fNewRefIORefma $fHasRefIO $fReadRefSTma$fReadRefSTSTa $fNewRefSTma $fReadRefIOma $fNewRefIOma$fWriteRefAccessorma$fReadRefAccessorma$fWriteRefSetterma$fReadRefGettermaGHC.Enumsucc GHC.TypesDouble$fPutMRefTVarIOa$fTakeMRefTVarIOa$fNewMRefTVarIOa$fPutMRefTVarSTMa$fTakeMRefTVarSTMa$fNewMRefTVarSTMa$fPutMRefTMVarIOa$fTakeMRefTMVarIOa$fNewMRefTMVarIOa$fPutMRefTMVarSTMa$fTakeMRefTMVarSTMa$fNewMRefTMVarSTMa $fHasMRefSTM$fPutMRefMRefIOa$fTakeMRefMRefIOa$fNewMRefMRefIOa$fPutMRefMVarma$fTakeMRefMVarma$fNewMRefMVarma $fHasMRefIO