haskell-lectures/VL2/content/VL2_map1.tex
Julian Ospald e9374aed1f
VL2: Restructure files, make the latex code more modular
Also added a few more section to make beamer and article more
compatible.
2015-04-20 18:06:58 +02:00

7 lines
357 B
TeX

Let's say we have a list of \code{Int} and want to add \code{2} to every element of the list.
\begin{haskellcode}
addTwo :: [Int] -> [Int]
addTwo ... ?
\end{haskellcode}
\pause
\textbf{Exercise:} Find the answer! 5 minutes time, remember the \emph{cons} operator \code{(:)}, pattern matching on lists and ofc recursion! Start with the case of an empty list.