*.tdo
*.toc
*.xdy
+img/fig-*
MAKEGLOSSARIESFLAGS?=
LATEXFLAGS:=-file-line-error -halt-on-error -no-shell-escape
+FIGURES:=$(addsuffix .png,$(addprefix img/,$(notdir $(basename $(wildcard fig/*.dot)))))
+
.PHONY: all clean
-.SECONDARY: $(addsuffix .fmt,$(DOCS))
+.SECONDARY: $(addsuffix .fmt,$(DOCS)) $(FIGURES)
all: $(addsuffix .pdf,$(DOCS))
%.pdf: %.mlog
if $(GREP) -iFq 'Rerun' $<; then $(LATEX) $(LATEXFLAGS) $(basename $<); fi
-%.mlog: %.tex %.fmt $(wildcard *.bib) $(wildcard *.tex)
+%.mlog: %.tex %.fmt $(wildcard *.bib) $(wildcard *.tex) $(FIGURES)
$(LATEX) $(LATEXFLAGS) $<
if $(GREP) -q '^\\bibdata{' $(basename $<).aux; then $(BIBTEX) $(BIBTEXFLAGS) $(basename $<); fi
if $(GREP) -q '\@istfilename' $(basename $<).aux; then $(MAKEGLOSSARIES) $(MAKEGLOSSARIESFLAGSFLAGS) $(basename $<); fi
$(LATEX) $(LATEXFLAGS) $< | tee $@
+img/%.png: fig/%.dot
+ dot -Tpng $< > $@
+
clean:
$(RM) $(foreach DOC,$(DOCS),$(addprefix $(DOC).,\
acn acr alg aux bbl blg fmt glg glo gls ist lof log lol lot nav out\
- pdf run.xml snm tdo toc vrb xdy))
+ pdf run.xml snm tdo toc vrb xdy)) $(FIGURES)
This thesis presents a way to connect small \gls{IoT} devices with high level
\gls{TOP} implementations languages. It shows how a new frontend for the class
-based shallowly embedded \glspl{EDSL} called \gls{mTask} written in \gls{Clean}
+based shallowly \glspl{EDSL} called \gls{mTask} written in \gls{Clean}
can be used to compile \gls{IoT}-tasks on the fly and send them to the device
-as bytecode which is interpreted. All of this adheres to the \gls{TOP}
-philosophy where familiar concepts such as \glspl{SDS} and task-combinators are
-available at ease.
+as interpretable bytecode. All of this adheres to the \gls{TOP} philosophy
+where familiar concepts such as \glspl{SDS} and task-combinators are available
+at ease.
--- /dev/null
+digraph {
+ graph [ dpi = 600 ];
+ rankdir=LR;
+ "NoValue" -> "Unstable";
+ "Unstable" -> "Stable";
+ "Unstable" -> "NoValue";
+}
--- /dev/null
+\section{\acrlong{EDSL}s}
+\todo{while iTasks is also a DSL\ldots}
+\glspl{mTask} are expressed in a class based shallowly embedded \gls{EDSL}.
+There are two main types of \glspl{EDSL}.
+\todo{Small shallow embedded dsl intro}
+\todo{Small deep embedded dsl}
+\todo{Show that class based has the best of both worlds}
-\section{\acrlong{TOP}}
-\subsection{\gls{iTasks}}
-\gls{TOP} is a recent new programming paradigm implemented as
-\gls{iTasks}\cite{achten_introduction_2015} in the pure lazy functional
-language \gls{Clean}\cite{brus_cleanlanguage_1987}. \gls{iTasks} is a
-\gls{EDSL} to model workflow tasks in the broadest sense. A \CI{Task} is just
-a function that, given some state, returns the observable value of the
-\CI{TaskValue}. A simple example is shown in Listing~\ref{lst:taskex}
-accompanied with Figure~\ref{fig:taskex1},~\ref{fig:taskex2} and~%
-\ref{fig:taskex3}.
-
-\begin{lstlisting}[language=Clean,label={lst:taskex},%
- caption={An example \gls{Task} for entering a name}]
-:: Name = { firstname :: String
- , lastname :: String
- }
-
-derive class iTask Name
-
-enterInformation :: String [EnterOption m] -> (Task m) | iTask m
-
-enterName :: Task Name
-enterName = enterInformation "Enter your name" []
-\end{lstlisting}
+\input{methods.top.tex}
-\begin{figure}[H]
- \begin{subfigure}{.25\textwidth}
- \centering
- \includegraphics[width=.9\linewidth]{taskex1}
- \caption{Initial interface}\label{fig:taskex1}
- \end{subfigure}
- \begin{subfigure}{.25\textwidth}
- \centering
- \includegraphics[width=.9\linewidth]{taskex2}
- \caption{Incomplete entrance}\label{fig:taskex2}
- \end{subfigure}
- \begin{subfigure}{.25\textwidth}
- \centering
- \includegraphics[width=.9\linewidth]{taskex3}
- \caption{Complete entry}\label{fig:taskex3}
- \end{subfigure}
- \caption{Example of a generated user interface}
-\end{figure}
-
-\subsection{Combinators}
-
-\section{\acrlong{EDSL}s}
-\todo{while iTasks is also a DSL\ldots}
-\glspl{mTask} are expressed in a class based shallowly embedded \gls{EDSL}.
-There are two main types of \glspl{EDSL}.
-\todo{Small shallow embedded dsl intro}
-\todo{Small deep embedded dsl}
-\todo{Show that class based has the best of both worlds}
+\input{methods.dsl.tex}
\section{Architecture}
\subsection{Devices}
--- /dev/null
+\section{\acrlong{TOP}}
+\subsection{\gls{iTasks}}
+\gls{TOP} is a recent new programming paradigm implemented as
+\gls{iTasks}\cite{achten_introduction_2015} in the pure lazy functional
+language \gls{Clean}\cite{brus_cleanlanguage_1987}. \gls{iTasks} is a
+\gls{EDSL} to model workflow tasks in the broadest sense. A \CI{Task} is just
+a function that, given some state, returns the observable \CI{TaskValue}. The
+\CI{TaskValue} of a \CI{Task} can have different states. Not all state
+transitions are possible as shown in Figure~\ref{fig:taskvalue}. Once a value
+has gone stable it can never become unstable again. Stability is often reached
+by pressing a confirmation button or for \glspl{Task} that offer a constant
+value. A simple example is shown in Listing~\ref{lst:taskex} accompanied with
+Figure~\ref{fig:taskex1},~\ref{fig:taskex2} and~\ref{fig:taskex3}. In this
+example the first image in is the \CI{NoValue} state, the second and third
+image are in the \CI{Unstable} state. When the user presses \emph{Continue} the
+value becomes \CI{Stable}.
+
+\begin{figure}[H]
+ \centering
+ \includegraphics[width=.5\linewidth]{fig-taskvalue}
+ \caption{The states of a \CI{TaskValue}}\label{fig:taskvalue}
+\end{figure}
+
+\begin{lstlisting}[language=Clean,label={lst:taskex},%
+ caption={An example \gls{Task} for entering a name}]
+:: Name = { firstname :: String
+ , lastname :: String
+ }
+
+derive class iTask Name
+
+enterInformation :: String [EnterOption m] -> (Task m) | iTask m
+
+enterName :: Task Name
+enterName = enterInformation "Enter your name" []
+\end{lstlisting}
+
+\begin{figure}[H]
+ \begin{subfigure}{.25\textwidth}
+ \centering
+ \includegraphics[width=.9\linewidth]{taskex1}
+ \caption{Initial interface}\label{fig:taskex1}
+ \end{subfigure}
+ \begin{subfigure}{.25\textwidth}
+ \centering
+ \includegraphics[width=.9\linewidth]{taskex2}
+ \caption{Incomplete entrance}\label{fig:taskex2}
+ \end{subfigure}
+ \begin{subfigure}{.25\textwidth}
+ \centering
+ \includegraphics[width=.9\linewidth]{taskex3}
+ \caption{Complete entry}\label{fig:taskex3}
+ \end{subfigure}
+ \caption{Example of a generated user interface}
+\end{figure}
+
+For a type to be suitable it must have instances for a collection of generic
+functions that are captured in the class \CI{iTask}. Basic types have
+specialization instances for these functions and show an according interface.
+Generated interfaces can be modified with decoration operators.
+
+
+\subsection{Combinators}
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
- tabsize=4 % sets default tabsize to 2 spaces
+ tabsize=4, % sets default tabsize to 2 spaces
+ frame=L
}
\title{iTasks and the Internet of Things}