You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
650 B

  1. \ifger{Lösung:}{Solution:}
  2. \begin{haskellcode}
  3. addTwo :: [Int] -> [Int]
  4. addTwo [] = []
  5. addTwo (x:xs) = (x + 2) : addTwo xs
  6. \end{haskellcode}
  7. \pause
  8. \ifger{Jetzt wollen wir jedes Element quadrieren:}{Now we want to square every element:}
  9. \pause
  10. \begin{haskellcode}
  11. square :: [Int] -> [Int]
  12. square [] = []
  13. square (x:xs) = (x * x) : square xs
  14. \end{haskellcode}
  15. \pause
  16. \ifger{Jetzt wollen wir den Betrag jedes Elements:}{Now we want the absolute of every element:}
  17. \begin{haskellcode}
  18. absList :: [Int] -> [Int]
  19. absList [] = []
  20. absList (x:xs) = (abs x) : absList xs
  21. \end{haskellcode}
  22. \pause
  23. \ifger{Fällt etwas auf?}{Do you notice something?}