From bd09b0cbd62a616801968174ca9927cfc7f90da0 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 2 Jun 2017 17:49:32 +0200 Subject: [PATCH] elaborate upon functional dependency! --- methods.mtask.tex | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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} -- 2.20.1