From 17aa6e0e7a6cfc96a85c25f6bf165336bfb3d8fd Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 9 Jul 2017 12:06:33 +0200 Subject: [PATCH] small updates --- pres.mtask.tex | 81 +++++++++++++++++++++++++++--------------------- presentation.pre | 4 ++- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/pres.mtask.tex b/pres.mtask.tex index 49a275f..5865640 100644 --- a/pres.mtask.tex +++ b/pres.mtask.tex @@ -19,15 +19,27 @@ \frametitle{Deep embedding} \begin{columns}[t] \column{.49\textwidth} - \begin{block}{What is deep embedding} - \begin{itemize} - \item The EDSL as an ADT - \item A view is a function transforming the ADT - \end{itemize} - \end{block} + \onslide<1->{ + \begin{block}{What is deep embedding} + \begin{itemize} + \item The EDSL as an ADT + \item A view is a function transforming the ADT + \end{itemize} + \end{block} + } + \onslide<3->{ + \begin{block}{Properties} + \begin{itemize} + \item Easy to add views + \item Hard to extend + \item Not type safe + \pause\item GADT + \end{itemize} + \end{block} + } \column{.49\textwidth} - \pause{} - \begin{lstlisting}[language=Clean] + \begin{onlyenv}<2-> + \begin{lstlisting}[language=Clean] :: DSL = LitI Int | LitB Bool | Var String | Plus DSL DSL | Minus DSL DSL | And DSL DSL @@ -35,32 +47,36 @@ eval :: DSL Env -> Env pprint :: DSL -> String - \end{lstlisting} + \end{lstlisting} + \end{onlyenv} \end{columns} - \pause{} - \begin{block}{Properties} - \begin{itemize} - \item Easy to add views - \item Hard to extend - \item Not type safe - \pause\item GADT - \end{itemize} - \end{block} \end{frame} \begin{frame}[fragile] \frametitle{Shallow embedding} \begin{columns}[t] \column{.49\textwidth} - \begin{block}{What is shallow embedding} - \begin{itemize} - \item The EDSL as a function - \item The view is embedded in the function - \end{itemize} - \end{block} - \pause{} + \onslide<1->{ + \begin{block}{What is shallow embedding} + \begin{itemize} + \item The EDSL as a function + \item The view is embedded in the function + \end{itemize} + \end{block} + } + + \onslide<2->{ + \begin{block}{Properties} + \begin{itemize} + \item Difficult to add views + \item Easy to extend + \item Type safe + \end{itemize} + \end{block} + } \column{.49\textwidth} - \begin{lstlisting}[language=Clean] + \begin{onlyenv}<2-> + \begin{lstlisting}[language=Clean] :: Env = ... :: DSL a = DSL (Env -> a) @@ -72,16 +88,9 @@ Var i = \e -> retrEnv e i Plus :: (DSL Int) (DSL Int) -> DSL Int Plus x y = \e -> x e + y e - \end{lstlisting} + \end{lstlisting} + \end{onlyenv} \end{columns} - \pause{} - \begin{block}{Properties} - \begin{itemize} - \item Difficult to add views - \item Easy to extend - \item Type safe - \end{itemize} - \end{block} \end{frame} \begin{frame}[fragile] @@ -223,7 +232,7 @@ class assign v where \frametitle{Examples} \begin{lstlisting}[language=Clean] blink = task \blink=(\x. - IF x) + IF x (ledOn LED1) (ledOff LED2) :. blink (lit 1000) (Not x)) diff --git a/presentation.pre b/presentation.pre index 98a4af6..e29ea69 100644 --- a/presentation.pre +++ b/presentation.pre @@ -2,6 +2,8 @@ \usepackage{listings} % Source code \usepackage{subcaption} % Subcaptions +\usepackage{lmodern} % Better teletype fonts +\usepackage{textcomp} % Nice listings quotes \usepackage[nodayofweek]{datetime} % Use a fixed document date % Beamer style @@ -55,7 +57,7 @@ breaklines=true, captionpos=b, keepspaces=true, - basicstyle=\ttfamily\fontseries{l}\scriptsize, + basicstyle=\ttfamily\scriptsize\fontseries{l}, commentstyle=\slshape\fontseries{m}, keywordstyle=\bfseries\fontseries{b}, stringstyle=\ttfamily, -- 2.20.1