From a8f9458649f43d3e63feba161b04e5cfcfa11fec Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 2 May 2015 13:59:58 +0200 Subject: [PATCH] Improve currying slides further --- VL2/content/VL2_currying5.1.tex | 10 ++++++++-- VL2/content/VL2_currying6.tex | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VL2/content/VL2_currying5.1.tex b/VL2/content/VL2_currying5.1.tex index 3ab0ce0..651ddfa 100644 --- a/VL2/content/VL2_currying5.1.tex +++ b/VL2/content/VL2_currying5.1.tex @@ -6,5 +6,11 @@ f x y z = x + y + z -- ...for this f = \x -> (\y -> (\z -> x + y + z)) -- right-associative \end{haskellcode} - -\ifger{Frage: was passiert, wenn wir nur $x = 3$ übergeben?}{Question: what happens if we just pass $x = 3$?} \ No newline at end of file +\ifger{Frage: was passiert, wenn wir nur $x = 3$ übergeben?}{Question: what happens if we just pass $x = 3$?} +\vspace{\baselineskip} +\\ +\pause +\ifger{Wieso nicht das?}{Why not this?} +\begin{haskellcode} +f = \x -> x + (\y -> y + (\z -> z)) -- no! +\end{haskellcode} \ No newline at end of file diff --git a/VL2/content/VL2_currying6.tex b/VL2/content/VL2_currying6.tex index ae8ea9a..2ff323b 100644 --- a/VL2/content/VL2_currying6.tex +++ b/VL2/content/VL2_currying6.tex @@ -8,8 +8,6 @@ addInt = \x -> (\y -> x + y) addTwo :: Int -> Int addTwo = addInt 2 --- equivalent to -addTwo = \y -> addInt 2 y \end{haskellcode} \ifger{Wir haben \hinline{addInt} ein Argument übergeben, also ist die Arität (im Beispiel vorher Dimension) einer weniger und damit ist noch ein Argument notwendig um den endgültigen Wert zu bekommen. \vspace{\baselineskip}\\