module Simulation.Aivika.Lattice.Ref.Base () where
import Simulation.Aivika.Trans.Internal.Types
import Simulation.Aivika.Trans.Comp
import Simulation.Aivika.Trans.Simulation
import Simulation.Aivika.Trans.Ref.Base
import Simulation.Aivika.Trans.Observable
import Simulation.Aivika.Lattice.Internal.LIO
import qualified Simulation.Aivika.Lattice.Internal.Ref as R
import Simulation.Aivika.Lattice.Internal.Estimate
import Simulation.Aivika.Lattice.Internal.Event
instance MonadRef LIO where
newtype Ref LIO a = Ref { refValue :: R.Ref a }
newRef = fmap Ref . R.newRef
readRef (Ref r) = R.readRef r
writeRef (Ref r) = R.writeRef r
modifyRef (Ref r) = R.modifyRef r
equalRef (Ref r1) (Ref r2) = (r1 == r2)
instance MonadRef0 LIO where
newRef0 = fmap Ref . R.newRef0
instance Observable (Ref LIO) (Estimate LIO) where
readObservable (Ref r) = estimateRef r