\begin{lstlisting}[caption={Device type},label={lst:mtaskdevice}]
:: Channels :== ([MTaskMSGRecv], [MTaskMSGSend], Bool)
\begin{lstlisting}[caption={Device type},label={lst:mtaskdevice}]
:: Channels :== ([MTaskMSGRecv], [MTaskMSGSend], Bool)
:: MTaskDeviceSpec = ... // Also explained in later sections
:: MTaskMSGRecv = ... // Message format, explained in later sections
:: MTaskMSGSend = ... // Also explained in later sections
:: MTaskDeviceSpec = ... // Also explained in later sections
:: MTaskMSGRecv = ... // Message format, explained in later sections
:: MTaskMSGSend = ... // Also explained in later sections
\begin{lstlisting}[label={lst:actualdev},%
caption={Device \gls{SDS}}]
\begin{lstlisting}[label={lst:actualdev},%
caption={Device \gls{SDS}}]
($<) a fb = fmap (const a) fb
deviceStore :: RWShared (Maybe (MTaskDevice, Int)) [MTaskDevice] [MTaskDevice]
($<) a fb = fmap (const a) fb
deviceStore :: RWShared (Maybe (MTaskDevice, Int)) [MTaskDevice] [MTaskDevice]
\begin{lstlisting}[caption={Local \gls{SDS}}]
deviceShare :: MTaskDevice -> Shared MTaskDevice
deviceShare d = mapReadWriteError
\begin{lstlisting}[caption={Local \gls{SDS}}]
deviceShare :: MTaskDevice -> Shared MTaskDevice
deviceShare d = mapReadWriteError
Nothing = exception "Device lost"
Just d = Ok d)
, \w ds->case splitWith ((==)d) ds of
Nothing = exception "Device lost"
Just d = Ok d)
, \w ds->case splitWith ((==)d) ds of