From: Mart Lubbers Date: Fri, 2 Jun 2017 15:49:32 +0000 (+0200) Subject: elaborate upon functional dependency! X-Git-Tag: hand-in~103 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=bd09b0cbd62a616801968174ca9927cfc7f90da0;p=msc-thesis1617.git elaborate upon functional dependency! --- 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}