haskell-lectures/VL2/content/VL2_anonymous_functions.tex

12 lines
597 B
TeX

\ifger{Wir können auch \textbf{anonyme Funktionen} haben, was eigentlich nur bedeutet, dass die Funktion keinen Namen hat:}{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
\ifger{Wobei dies praktisch dasselbe ist wie:}{Although this is basically the same as:}
\begin{haskellcode}
f :: Int -> Int
f x = x + 1
\end{haskellcode}
\ifger{Anonyme Funktionen werden für uns später sehr nützlich sein.}{Anonymous functions will come extremely handy later, you'll see.}