From ca0f732f08a52010fc433498ea795cb1f2df6f57 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 19 Apr 2015 17:54:25 +0200 Subject: [PATCH] Improve function composition slides --- VL2.tex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/VL2.tex b/VL2.tex index a15d81b..cd008d4 100644 --- a/VL2.tex +++ b/VL2.tex @@ -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}