process notes in first sections
[msc-thesis1617.git] / methods.top.tex
1 \section{\acrlong{TOP}}
2 \subsection{\gls{iTasks}}
3 \gls{TOP} is a recent programming paradigm implemented as
4 \gls{iTasks}\cite{achten_introduction_2015} in the pure lazy functional
5 language \gls{Clean}\cite{brus_cleanlanguage_1987}. \gls{iTasks} is a
6 \gls{EDSL} to model workflow tasks in the broadest sense. A \CI{Task} is just
7 a function that, given some state, returns the observable \CI{TaskValue}. The
8 \CI{TaskValue} of a \CI{Task} can have different states. Not all state
9 transitions are possible as shown in Figure~\ref{fig:taskvalue}. Once a value
10 is stable it can never become unstable again. Stability is often reached
11 by pressing a confirmation button. \glspl{Task} yielding a constant value are
12 immediately stable.
13
14 A simple \gls{iTasks} example illustrating the route to stability of a
15 \gls{Task} in which the user has to enter a full name is shown in
16 Listing~\ref{lst:taskex}. The code is accompanied by screenshots showing the
17 user interface in Figure~\ref{fig:taskex1},~\ref{fig:taskex2}
18 and~\ref{fig:taskex3}. The \CI{TaskValue} of the \gls{Task} is in the first
19 image in the \CI{NoValue} state, the second and third image have an
20 \CI{Unstable} state. When the user presses \emph{Continue} the value becomes
21 \CI{Stable}.
22
23 \begin{figure}[H]
24 \centering
25 \includegraphics[width=.5\linewidth]{fig-taskvalue}
26 \caption{The states of a \CI{TaskValue}}\label{fig:taskvalue}
27 \end{figure}
28
29 \begin{lstlisting}[language=Clean,label={lst:taskex},%
30 caption={An example \gls{Task} for entering a name}]
31 :: Name = { firstname :: String
32 , lastname :: String
33 }
34
35 derive class iTask Name
36
37 enterInformation :: String [EnterOption m] -> (Task m) | iTask m
38
39 enterName :: Task Name
40 enterName = enterInformation "Enter your name" []
41 \end{lstlisting}
42
43 \begin{figure}[H]
44 \begin{subfigure}{.25\textwidth}
45 \centering
46 \includegraphics[width=.9\linewidth]{taskex1}
47 \caption{Initial interface}\label{fig:taskex1}
48 \end{subfigure}
49 \begin{subfigure}{.25\textwidth}
50 \centering
51 \includegraphics[width=.9\linewidth]{taskex2}
52 \caption{Incomplete entrance}\label{fig:taskex2}
53 \end{subfigure}
54 \begin{subfigure}{.25\textwidth}
55 \centering
56 \includegraphics[width=.9\linewidth]{taskex3}
57 \caption{Complete entry}\label{fig:taskex3}
58 \end{subfigure}
59 \caption{Example of a generated user interface}
60 \end{figure}
61
62 For a type to be suitable it must have instances for a collection of generic
63 functions that are captured in the class \CI{iTask}. Basic types have
64 specialization instances for these functions and show an according interface.
65 Generated interfaces can be modified with decoration operators.
66
67 \subsection{Combinators}
68 \todo{Stukje over combinators, in ieder geval bind en paralel}