X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=methods.mtask.tex;h=4a71394d5b977bd85316dc9a234570aba59685e2;hb=f2e6ff2a8f86466af7d789e901d08b90661f8b31;hp=5bdbbb1db3f162006b9b9e7da5462820718364b5;hpb=435b0d98d22a47530f50ff82f2451e70ce2bed96;p=msc-thesis1617.git diff --git a/methods.mtask.tex b/methods.mtask.tex index 5bdbbb1..4a71394 100644 --- a/methods.mtask.tex +++ b/methods.mtask.tex @@ -68,15 +68,23 @@ as \emph{while} or \emph{for} constructions. The main control flow operators are the sequence operator and the \emph{if} statement. Both are shown in Listing~\ref{lst:control}. The first class of \emph{If} statements describes the regular \emph{if} statement. The expressions given can have any role. The -functional dependency\todo{explain} on \CI{s} determines the return type of the -statement. The sequence operator is very straightforward and just ties the two -expressions together in sequence. +functional dependency on \CI{s} determines the return type of the +statement. The listing includes examples of implementations that illustrate +this dependency. + +The sequence operator is very straightforward and just ties +the two expressions together in sequence. \begin{lstlisting}[% language=Clean,label={lst:control},caption={Control flow operators}] class If v q r ~s where If :: (v Bool p) (v t q) (v t r) -> v t s | ... +instance If Code Stmt Stmt Stmt +instance If Code e Stmt Stmt +instance If Code Stmt e Stmt +instance If Code x y Expr + class seq v where (:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | ... \end{lstlisting}