diff --git a/VL2/content/VL2_filter2.tex b/VL2/content/VL2_filter2.tex index f9a10b7..134e989 100644 --- a/VL2/content/VL2_filter2.tex +++ b/VL2/content/VL2_filter2.tex @@ -6,7 +6,7 @@ filter :: (a -> Bool) -> [a] -> [a] \pause \begin{haskellcode} filter :: (a -> Bool) -> [a] -> [a] -filter f [] = [] +filter f [] = [] filter f (x:xs) | f x = x : filter f xs | otherwise = filter f xs diff --git a/VL2/content/VL2_fold1.tex b/VL2/content/VL2_fold1.tex index 3994fa6..12f9cf0 100644 --- a/VL2/content/VL2_fold1.tex +++ b/VL2/content/VL2_fold1.tex @@ -6,20 +6,20 @@ sum :: [Int] -> Int \pause \begin{haskellcode} sum :: [Int] -> Int -sum [] = 0 +sum [] = 0 sum (x:xs) = x + sum xs \end{haskellcode} \pause \ifger{Oder das Produkt:}{Or the product:} \begin{haskellcode} prod :: [Int] -> Int -prod [] = 1 +prod [] = 1 prod (x:xs) = x * prod xs \end{haskellcode} \pause \ifger{Oder die Länge:}{Or the length:} \begin{haskellcode} length :: [a] -> Int -length [] = 0 +length [] = 0 length (x:xs) = 1 + length xs \end{haskellcode} \ No newline at end of file diff --git a/VL2/content/VL2_map2.tex b/VL2/content/VL2_map2.tex index a2bd319..02c5c80 100644 --- a/VL2/content/VL2_map2.tex +++ b/VL2/content/VL2_map2.tex @@ -1,7 +1,7 @@ \ifger{Lösung:}{Solution:} \begin{haskellcode} addTwo :: [Int] -> [Int] -addTwo [] = [] +addTwo [] = [] addTwo (x:xs) = (x + 2) : addTwo xs \end{haskellcode} \pause @@ -9,14 +9,14 @@ addTwo (x:xs) = (x + 2) : addTwo xs \pause \begin{haskellcode} square :: [Int] -> [Int] -square [] = [] +square [] = [] square (x:xs) = (x * x) : square xs \end{haskellcode} \pause \ifger{Jetzt wollen wir den Betrag jedes Elements:}{Now we want the absolute of every element:} \begin{haskellcode} absList :: [Int] -> [Int] -absList [] = [] +absList [] = [] absList (x:xs) = (abs x) : absList xs \end{haskellcode} \pause