Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

22 righe
1.0 KiB

  1. \ifger{Schreiben wir unsere erste Funktion. Wir wollen etwas wie die folgende mathematische Funktion:}{Let's make our first function. We want something like the following mathematical function}\\
  2. $f(x) = x * x$
  3. \vspace{\baselineskip}
  4. \\
  5. \ifger{Wie könnte der Haskell code aussehen?}{How could the haskell code look like?}
  6. \pause
  7. \ifger{Beinahe genauso:}{Almost the same:}
  8. \begin{haskellcode}
  9. f x = x * x
  10. \end{haskellcode}
  11. \vspace{\baselineskip}
  12. GHCi...
  13. \pause
  14. \vspace{\baselineskip}
  15. \\
  16. \ifger{Was ist eine mögliche Typsignatur dieser Funktion?}{What is a possible type signature for this function?}
  17. \pause
  18. \begin{haskellcode}
  19. f :: Int -> Int
  20. f x = x * x
  21. \end{haskellcode}
  22. \ifger{Also, die Funktion bekommt einen \hinline{Int} als Eingabe und gibt einen \hinline{Int} als Ausgabe zurück. Lasst Euch nicht von}{So the function gets an \hinline{Int} and returns an \hinline{Int}. Don't get confused by} \hinline{->} \ifger{verwirren.}{.} \ifger{Seht es einfach als Symbol zum Trennen von Eingabe und Ausgabe}{Just think of it as a symbol for separating input and output}.