Camil's comments: chapter 5
[msc-thesis1617.git] / methods.mtask.tex
index d8d9fdf..1f5c4ec 100644 (file)
@@ -70,7 +70,9 @@ 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 on \CI{s} determines the return type of the statement.
 The listing includes examples of implementations that illustrate this
-dependency.
+dependency. A special \emph{If} statement --- only used for statements --- is
+also added under the name \CI{IF}, of which the \CI{?} is a conditional
+statement to execute.
 
 The sequence operator is straightforward and its only function is to tie
 two expressions together. The left expression is executed first, followed by
@@ -81,6 +83,10 @@ the right expression.
 class If v q r ~s where
   If :: (v Bool p) (v t q) (v t r) -> v t s | ...
 
+class IF v where
+  IF :: (v Bool p) (v t q) (v s r) -> v () Stmt | ...
+  (?) infix 1 :: (v Bool p) (v t q) -> v () Stmt | ...
+
 instance If Code Stmt Stmt Stmt
 instance If Code e    Stmt Stmt
 instance If Code Stmt e    Stmt