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.
 
 
 

14 lines
571 B

  1. \ifger{Wir werden die Rekursionsstruktur erneut herausabstrahieren! Die Typsignatur sieht so aus:}{Let's abstract out the common pieces! This will be our type signature:}
  2. \begin{haskellcode}
  3. filter :: (a -> Bool) -> [a] -> [a]
  4. \end{haskellcode}
  5. \ifger{Lösung?}{Solution?}
  6. \pause
  7. \begin{haskellcode}
  8. filter :: (a -> Bool) -> [a] -> [a]
  9. filter f [] = []
  10. filter f (x:xs)
  11. | f x = x : filter f xs
  12. | otherwise = filter f xs
  13. \end{haskellcode}
  14. \ifger{Diese Funktion ist ebenfalls Teil von \emph{Prelude}.}{Again: this function is part of the \emph{Prelude} as well.}