\begin{document}
\frame{\titlepage}
+\begin{frame}[fragile]
+ \frametitle{Today}
+ \begin{itemize}
+ \item Higher order functions
+ \item Anonymous lambda functions
+ \item Syntactic sugar
+ \item Future work
+ \item Demo
+ \end{itemize}
+\end{frame}
+
\begin{frame}[fragile]
\frametitle{Higher order functions implemented using function pointers}
\end{frame}
\begin{frame}[fragile]
- \frametitle{Functions application can be curried}
+ \frametitle{Function application can be curried}
\begin{SPLCode}
plus(x,y) :: Int -> Int -> Int {
}
main() {
- map(plus(1), 1:2:3:[]);
+ map(plus(4), 1:2:3:[]);
}
\end{SPLCode}
\pause
\item We want to protect our users from global state (as much
as possible).
\end{itemize}
- \item Global constants allowed through \texttt{Let} statements
- \item \texttt{<LetDecl> ::= `Let' <type> <id> `=' <Expr> `;'}
+ \item Global constants allowed through \texttt{let} statements
+ \item \texttt{<LetDecl> ::= `let' <type> <id> `=' <Expr> `;'}
\item Lets are rewritten to constant functions
\end{itemize}
\begin{columns}[T]
\begin{column}[T]{0.4\linewidth}
\begin{SPLCode}
-Let Int x = 5;
+let Int x = 5;
\end{SPLCode}
\end{column}
\begin{column}[T]{0.4\linewidth}
\begin{columns}[T]
\begin{column}[T]{0.34\linewidth}
\begin{SPLCode}
-print("x is: ", x);
+print("x is: ", x, "\n");
\end{SPLCode}
\end{column}
\begin{column}[T]{0.5\linewidth}
\begin{SPLCode}
print("x is: ");
print(x);
+print("\n");
\end{SPLCode}
\end{column}
\end{columns}