\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
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)
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]
\frametitle{Examples}
\begin{lstlisting}[language=Clean]
blink = task \blink=(\x.
- IF x)
+ IF x
(ledOn LED1)
(ledOff LED2) :.
blink (lit 1000) (Not x))
\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
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,