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
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 image does not have all the fields
20 filled in and therefore the
\CI{TaskValue
} remains
\CI{Unstable
}. In the third
21 image all fields are entered and the
\CI{TaskValue
} transitions to the
22 \CI{Unstable
} state. When the user presses
\emph{Continue
} the value becomes
23 \CI{Stable
} and can not be changed any further.
27 \includegraphics[width=
.5\linewidth]{fig-taskvalue
}
28 \caption{The states of a
\CI{TaskValue
}}\label{fig:taskvalue
}
31 \begin{lstlisting
}[language=Clean,label=
{lst:taskex
},
%
32 caption=
{An example
\gls{Task
} for entering a name
}]
33 :: Name =
{ firstname :: String
37 derive class iTask Name
39 enterInformation :: String
[EnterOption m
] -> (Task m) | iTask m
41 enterName :: Task Name
42 enterName = enterInformation "Enter your name"
[]
46 \begin{subfigure
}{.25\textwidth}
48 \includegraphics[width=
.9\linewidth]{taskex1
}
49 \caption{Initial interface
}\label{fig:taskex1
}
51 \begin{subfigure
}{.25\textwidth}
53 \includegraphics[width=
.9\linewidth]{taskex2
}
54 \caption{Incomplete entrance
}\label{fig:taskex2
}
56 \begin{subfigure
}{.25\textwidth}
58 \includegraphics[width=
.9\linewidth]{taskex3
}
59 \caption{Complete entry
}\label{fig:taskex3
}
61 \caption{Example of a generated user interface
}
64 For a type to be suitable it must have instances for a collection of generic
65 functions that are captured in the class
\CI{iTask
}. Basic types have
66 specialization instances for these functions and show an according interface.
67 Generated interfaces can be modified with decoration operators.
69 \subsection{Combinators
}
70 \todo{Stukje over combinators, in ieder geval bind en paralel
}