combinators.
\gls{iTasks} has been proven to be useful in many fields of operation such as
-incident management~~\cite{lijnse_top_2013}. Interfaces are automatically
+incident management~\cite{lijnse_top_2013}. Interfaces are automatically
generated for the types of data which makes rapid development possible.
\Glspl{Task} in the \gls{iTasks} system are modelled after real life workflow
tasks but the modelling is applied on a very high level. Therefore it is
small \gls{IoT} devices have limited processing power but can still contain
decision making. Oortgiese et al.\ lifted \gls{iTasks} from a single server
model to a distributed server architecture that is also runnable on small
-devices such as those powered by \acrshort{ARM}~~\cite{%
+devices such as those powered by \acrshort{ARM}~\cite{%
oortgiese_distributed_2017}. However, this is limited to fairly high
performance devices that are equipped with high speed communication channels.
Devices in \gls{IoT} often have only \gls{LTN} communication with low bandwidth
resource are notified of the update. However, it may be the case that
\glspl{Task} were only looking at parts of the structure that was not updated.
To solve this problem, parametric lenses were
-introduced~~\cite{domoszlai_parametric_2014}.
+introduced~\cite{domoszlai_parametric_2014}.
Parametric lenses add a type variable to the \gls{SDS} that is in the current
library functions fixed to the void type (i.e. \CI{()}). When a \gls{SDS}
\CI{p} is the parametric lens type. This allows programmers to create a big
\gls{SDS}, and have \glspl{Task} only look at parts of the big \gls{SDS}. This
technique is used in the current system in memory shares. The \CI{IWorld}
-contains a map that is accessible through an \gls{SDS}. While all data is
+contains a map that is accessible through a \gls{SDS}. While all data is
stored in the map, only \glspl{Task} looking at a specific entry are notified
when the structure is updated. The type of the parametric lens is the key in
the map.
Functionality for setting parameters is added in the system. The most important
-function is the \CI{sdsFocus} function. This function is listed in
-Listing~\ref{lst:focus} and allows the programmer to fix the parametric lens to
-a specific value.
+functions are the \CI{sdsFocus} and the \CI{sdsLens} function. These functions
+are listed in Listing~\ref{lst:focus}. \CI{sdsFocus} allows the programmer to
+fix a parametric lens value. \CI{sdsLens} is a kind of \CI{mapReadWrite}
+including access to the parametric lens value. This allows the creation of
+for example \glspl{SDS} that only read and write to parts of the original
+\gls{SDS}.
\begin{lstlisting}[label={lst:focus},
caption={Parametric lens functions}]
sdsFocus :: p (RWShared p r w) -> RWShared p` r w | iTask p
+
+:: SDSNotifyPred p :== p -> Bool
+
+:: SDSLensRead p r rs = SDSRead (p -> rs -> MaybeError TaskException r)
+ | SDSReadConst (p -> r)
+:: SDSLensWrite p w rs ws = SDSWrite (p -> rs -> w -> MaybeError TaskException (Maybe ws))
+ | SDSWriteConst (p -> w -> MaybeError TaskException (Maybe ws))
+:: SDSLensNotify p w rs = SDSNotify (p -> rs -> w -> SDSNotifyPred p)
+ | SDSNotifyConst (p -> w -> SDSNotifyPred p)
+
+sdsLens :: String (p -> ps) (SDSLensRead p r rs) (SDSLensWrite p w rs ws) (SDSLensNotify p w rs)
+ (RWShared ps rs ws) -> RWShared p r w | iTask ps
\end{lstlisting}
variables are added. This means that the programmer has to unbox the
\CI{ByteCode} object to be able to use return values for the monad. Tailor made
access functions are used to achieve this with ease. The fresh variable stream
-in a compiler using an \gls{RWST} is often put into the \emph{Reader} part of
+in a compiler using a \gls{RWST} is often put into the \emph{Reader} part of
the monad. However, not all code is compiled immediately and later on the fresh
variable stream cannot contain variables that were used before. Therefore this
information is put in the state which is kept between compilations.
addSDS sds v s = {s & sdss=[{sds & sdsval=BCValue v}:s.sdss]}
\end{lstlisting}
-All assignable types compile to an \gls{RWST} that writes one instruction. For
-example, using an \gls{SDS} always results in an expression of the form
+All assignable types compile to a \gls{RWST} that writes one instruction. For
+example, using a \gls{SDS} always results in an expression of the form
\CI{sds \x=4 In ...}. The actual \CI{x} is the \gls{RWST} that always writes
one \CI{BCSdsFetch} instruction with the correct \gls{SDS} embedded. When the
call of the \CI{x} is not a read but an assignment, the instruction will be
\documentclass[twoside,a4paper,titlepage]{book}
-\usepackage[british]{babel}
-\usepackage{makeidx} % Index
\usepackage{geometry} % Papersize
+\usepackage[british]{babel} % Internationalization
\usepackage[titletoc]{appendix} % Appendices
\usepackage{hyperref} % Hyperlinks
\usepackage{booktabs} % Better looking tables
\usepackage{todonotes} % Todo's
\usepackage{caption} % Captions
\usepackage{subcaption} % Subcaptions
-\usepackage{lipsum} % dummy text
\usepackage{listings} % source code
\usepackage{float} % floating images
\usepackage{lmodern} % Better teletype fonts
\listofalgorithms%
\endgroup
-\printindex
-
\end{document}