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