1 \gls{TOP
} is a novel programming paradigm implemented as
2 \gls{iTasks
}~
\cite{achten_introduction_2015
} in the pure lazy functional
3 language
\gls{Clean
}~
\cite{brus_cleanlanguage_1987
}.
\gls{iTasks
} is an
4 \gls{EDSL
} to model workflow tasks in the broadest sense. A
\gls{Task
} is just
5 a function that --- given some state --- returns the observable
\CI{TaskValue
}.
6 The
\CI{TaskValue
} of a
\CI{Task
} can have different states. Not all state
7 transitions are possible as shown in Figure~
\ref{fig:taskvalue
}. Once a value
8 is stable it can never become unstable again. Stability is often reached by
9 pressing a confirmation button.
\glspl{Task
} yielding a constant value are
12 A simple
\gls{iTasks
} example illustrating the route to stability of a
13 \gls{Task
} in which the user has to enter a full name is shown in
14 Listing~
\ref{lst:taskex
}. The code is accompanied by screenshots showing the
15 user interface in Figure~
\ref{fig:taskex1
},~
\ref{fig:taskex2
}
16 and~
\ref{fig:taskex3
}. The
\CI{TaskValue
} of the
\gls{Task
} is in the first
17 image in the
\CI{NoValue
} state, the second image does not have all the fields
18 filled in and therefore the
\CI{TaskValue
} remains
\CI{NoValue
}. In the third
19 image all fields are entered and the
\CI{TaskValue
} transitions to the
20 \CI{Unstable
} state. When the user presses
\emph{Continue
} the value becomes
21 \CI{Stable
} and cannot be changed any further.
25 \includegraphics[width=
.5\linewidth]{fig-taskvalue
}
26 \caption{The states of a
\CI{TaskValue
}}\label{fig:taskvalue
}
29 \begin{lstlisting
}[label=
{lst:taskex
},
%
30 caption=
{An example
\gls{Task
} for entering a name
}]
31 :: Name =
{ firstname :: String
35 derive class iTask Name
37 enterInformation :: String
[EnterOption m
] -> (Task m) | iTask m
39 enterName :: Task Name
40 enterName = enterInformation "Enter your name"
[]
45 \begin{subfigure
}{.25\textwidth}
47 \includegraphics[width=
.9\linewidth]{taskex1
}
48 \caption{Initial interface
}\label{fig:taskex1
}
50 \begin{subfigure
}{.25\textwidth}
52 \includegraphics[width=
.9\linewidth]{taskex2
}
53 \caption{Incomplete entrance
}\label{fig:taskex2
}
55 \begin{subfigure
}{.25\textwidth}
57 \includegraphics[width=
.9\linewidth]{taskex3
}
58 \caption{Complete entry
}\label{fig:taskex3
}
60 \caption{Example of a generated user interface
}
63 For a type to be suitable, it must have instances for a collection of generic
64 functions that is captured in the class
\CI{iTask
}. Basic types have
65 specialization instances for these functions and show an interface accordingly.
66 Derived interfaces can be modified with decoration operators or specializations