{-# LANGUAGE FlexibleInstances #-}
module Simulation.Aivika.Distributed.Optimistic.Internal.IO
(MonadIOUnsafe(..)) where
import Control.Monad
import Control.Monad.Trans
import Simulation.Aivika.Trans
import Simulation.Aivika.Distributed.Optimistic.Internal.DIO
class MonadIOUnsafe m where
liftIOUnsafe :: IO a -> m a
instance MonadIOUnsafe DIO where
liftIOUnsafe = DIO . const . liftIO
instance MonadIOUnsafe (Parameter DIO) where
liftIOUnsafe = liftComp . DIO . const . liftIO
instance MonadIOUnsafe (Simulation DIO) where
liftIOUnsafe = liftComp . DIO . const . liftIO
instance MonadIOUnsafe (Dynamics DIO) where
liftIOUnsafe = liftComp . DIO . const . liftIO
instance MonadIOUnsafe (Event DIO) where
liftIOUnsafe = liftComp . DIO . const . liftIO