{-# LANGUAGE LinearTypes #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Control.Monad.IO.Class.Linear where
import qualified Control.Functor.Linear as Linear
import Prelude.Linear
import qualified System.IO as System
import qualified System.IO.Linear as Linear
class Linear.Monad m => MonadIO m where
liftIO :: Linear.IO a %1-> m a
liftSystemIO :: System.IO a -> m a
liftSystemIO IO a
io = IO a %1 -> m a
forall (m :: * -> *) a. MonadIO m => IO a %1 -> m a
liftIO (IO a %1 -> IO a
forall a. IO a %1 -> IO a
Linear.fromSystemIO IO a
io)
liftSystemIOU :: System.IO a -> m (Ur a)
liftSystemIOU IO a
io = IO (Ur a) %1 -> m (Ur a)
forall (m :: * -> *) a. MonadIO m => IO a %1 -> m a
liftIO (IO a -> IO (Ur a)
forall a. IO a -> IO (Ur a)
Linear.fromSystemIOU IO a
io)
instance MonadIO Linear.IO where
liftIO :: forall a. IO a %1 -> IO a
liftIO = IO a %1 -> IO a
forall a. a %1 -> a
id