Improve function composition slides

Cette révision appartient à :
Julian Ospald 2015-04-19 17:54:25 +02:00
Parent db59997841
révision ca0f732f08
Signature inconnue de Gitea
ID de la clé GPG: 220CD1C5BDEED020
1 fichiers modifiés avec 9 ajouts et 0 suppressions

Voir le fichier

@ -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}