haskell-lectures/VL2/content/VL2_composition2.tex

18 lines
850 B
TeX

\ifger{Aber das soll uns nicht genug sein. Was bedeutet dieser Punkt \hinline{(.)} tatsächlich?}{But let's not stop here. What does the dot \hinline{(.)} actually mean?}
\vspace{\baselineskip}
\\
\pause
\ifger{Es ist einfach nur eine Funktion (die \emph{Prefix} Variante von \hinline{.})!}{It's just a function (the \emph{prefix} version of \hinline{.})! Here is the type signature:}
\begin{haskellcode}
(.) :: (b -> c) -> (a -> b) -> a -> c
\end{haskellcode}
\pause
\textbf{\ifger{Aufgabe:}{Exercise:}} \ifger{Implementiert es! Es ist tatsächlich nur eine Zeile. Erinnert Euch an die mathematische Definition.}{Implement it! It's really just one line! Remember the mathematical definition.}
\vspace{\baselineskip}
\\
\pause
\ifger{Lösung:}{Solution:}
\begin{haskellcode}
(.) :: (b -> c) -> (a -> b) -> a -> c
(.) f g x = f (g x)
\end{haskellcode}