update presentation, the body is there
[msc-thesis1617.git] / pres.mtask.tex
index ec40ae4..49a275f 100644 (file)
@@ -27,7 +27,7 @@
                \end{block}
                \column{.49\textwidth}
                \pause{}
-               \begin{lstlisting}
+               \begin{lstlisting}[language=Clean]
 :: DSL = LitI  Int     | LitB  Bool
        | Var   String  | Plus  DSL DSL
        | Minus DSL DSL | And   DSL DSL
@@ -60,7 +60,7 @@ pprint :: DSL -> String
                \end{block}
                \pause{}
                \column{.49\textwidth}
-               \begin{lstlisting}
+               \begin{lstlisting}[language=Clean]
 :: Env   = ...
 :: DSL a = DSL (Env -> a)
 
@@ -107,7 +107,7 @@ Plus x y = \e -> x e + y e
                }
                \column{.49\textwidth}
                \begin{onlyenv}<2->
-                       \begin{lstlisting}
+                       \begin{lstlisting}[language=Clean]
 :: Env   = ...
 :: Evaluator a = Evaluator (Env -> a)
 :: PrettyPrinter a = PP String
@@ -140,7 +140,7 @@ instance intArith PrettyPrinter where
        \begin{block}{What is mTask}
                \begin{itemize}
                        \item Created by Pieter Koopman and Rinus Plasmeijer
-                       \item EDSL
+                       \item EDSL for imperative programs
                        \item Arduino C++ generation, iTasks simulation
                \end{itemize}
        \end{block}
@@ -157,13 +157,10 @@ instance intArith PrettyPrinter where
 \begin{frame}[fragile]
        \frametitle{Expressions}
        \begin{block}{mTask}
-               \begin{itemize}[<+->]
-                       \item Of the form \CI{v t p}
-                       \item \CI{p} is hierarchical
-               \end{itemize}
+               Of the form \CI{v t p}
        \end{block}
        \pause{}
-       \begin{lstlisting}
+       \begin{lstlisting}[language=Clean]
 class arith v where
   lit           :: t -> v t Expr
   (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | +, zero t & isExpr p & isExpr q
@@ -179,7 +176,7 @@ class boolExpr v where
 
 \begin{frame}[fragile]
        \frametitle{Control flow}
-       \begin{lstlisting}
+       \begin{lstlisting}[language=Clean]
 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 | ...
@@ -191,7 +188,7 @@ class seq v where
 
 \begin{frame}[fragile]
        \frametitle{Assignment and Input/Output}
-       \begin{lstlisting}
+       \begin{lstlisting}[language=Clean]
 :: DigitalPin = D0 | D1 | D2 ...
 :: AnalogPin  = A0 | A1 | A2 ...
 
@@ -210,7 +207,7 @@ class digitalRead v where
 
 \begin{frame}[fragile]
        \frametitle{Shared Data Sources and Assignment}
-       \begin{lstlisting}
+       \begin{lstlisting}[language=Clean]
 :: In a b = In infix 0 a b
 :: Main a = {main :: a}
 
@@ -224,26 +221,18 @@ class assign v where
 
 \begin{frame}[fragile]
        \frametitle{Examples}
-       \begin{lstlisting}
+       \begin{lstlisting}[language=Clean]
 blink = task \blink=(\x.
-            IF (x ==. lit True)
+            IF x)
                (ledOn LED1)
                (ledOff LED2) :.
             blink (lit 1000) (Not x))
         In {main=blink (lit 1000) True}
 
 thermostat :: Main (View () Stmt)
-thermostat = {main = IF (analogRead A0 >. lit 50)
-                        ( digitalWrite D0 (lit True)  )
-                        ( digitalWrite D0 (lit False) )
-             }
+thermostat = {main = digitalWrite (dIO D0) (analogRead A0 >. lit 50)
 
 thermostat2 :: Main (View () Stmt)
-thermostat2 = let a0 = aIO A0
-                  d0 = dIO D0
-              in {main = IF (a0 >. lit 50)
-                            (d0 =. lit True)
-                            (d0 =. lit False)
-              }
+thermostat = {main = (dIO D0) =. (analogRead A0 >. lit 50)
        \end{lstlisting}
 \end{frame}