haskell-lectures/VL2/content/VL2_define_functions5.tex
2015-04-20 00:51:14 +02:00

12 lines
350 B
TeX

We can also have \textbf{anonymous functions} which just means the function doesn't have a name:
\begin{haskellcode}
f :: Int -> Int
f x = (\y -> y + 1) x
\end{haskellcode}
\pause
Although this is basically the same as:
\begin{haskellcode}
f :: Int -> Int
f x = x + 1
\end{haskellcode}
Anonymous functions will come extremely handy later, you'll see.