Improve function composition slides

This commit is contained in:
Julian Ospald 2015-04-19 17:54:25 +02:00
vecāks db59997841
revīzija ca0f732f08
Šim parakstam datu bāzē netika atrasta zināma atslēga
GPG atslēgas ID: 220CD1C5BDEED020
1 mainīti faili ar 9 papildinājumiem un 0 dzēšanām

Parādīt failu

@ -366,6 +366,15 @@ Solution:
(.) :: (b -> c) -> (a -> b) -> a -> c
(.) f g x = f (g x)
\end{haskellcode}
\pause
And now you can chain functions together. Not just two! Look:
\begin{haskellcode}
f :: String -> Bool
f xs = (even . length . (\x -> x ++ "Hello world")) xs
-- or less ugly
f xs = even . length . (\x -> x ++ "Hello world") $ xs
\end{haskellcode}
% $
\end{frame}
\section{6. Recursion patterns}